summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/pkg13
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/pkg b/bin/pkg
index ce8f3d7..cc06494 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -232,15 +232,16 @@ function vcs_log {
function vcs_upgrade {
typeset IFS=$'\n' line
- typeset -i merge_ok=0
+ typeset branch
for line in $(git branch); {
- [[ $line == '* master' ]] && merge_ok=1
+ [[ $line == \*\ * ]] && branch=${line#* }
}
- if ((merge_ok)) {
- git pull $PKG_ROOT/${PWD:t} master
- } else {
- git fetch $PKG_rOOT/${PWD:t} master
+ debug "branch = $branch"
+ if [[ -z $branch ]] {
+ warn "vcs_upgrade: $PWD: cannot determine current branch, not pulling"
+ return 1
}
+ git pull $PKG_ROOT/${PWD:t} $branch
}
function vcs_push {