From b45548b814d95164bfe11c7538784ce06d06f62f Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 29 Dec 2008 17:58:46 +0100 Subject: bin/pkg: Try to use git fetch to avoid merging master into another branch by accident --- bin/pkg | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bin/pkg') diff --git a/bin/pkg b/bin/pkg index 1bc1c35..352e3df 100755 --- a/bin/pkg +++ b/bin/pkg @@ -229,7 +229,16 @@ function vcs_log { } function vcs_upgrade { - git pull $PKG_ROOT/${PWD:t} master + typeset IFS=$'\n' line + typeset -i merge_ok=0 + for line in $(git branch) { + [[ $line == '* master' ]] && ok=1 + } + if ((ok)) { + git pull $PKG_ROOT/${PWD:t} master + } else { + git fetch $PKG_rOOT/${PWD:t} master + } } function vcs_push { -- cgit v1.2.3