summaryrefslogtreecommitdiff
path: root/bin/pkg
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-12-29 17:58:46 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2008-12-29 17:58:46 +0100
commitb45548b814d95164bfe11c7538784ce06d06f62f (patch)
tree4d9663d434fd28b575491a5633b341e77763fd90 /bin/pkg
parentf2dd08b67798e5e47041b584c273d053fed96a3b (diff)
bin/pkg: Try to use git fetch to avoid merging master into another branch by accident
Diffstat (limited to 'bin/pkg')
-rwxr-xr-xbin/pkg11
1 files changed, 10 insertions, 1 deletions
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 {