summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 {