summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-01-07 17:57:54 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2009-01-07 17:57:54 +0100
commitec173b864148f38f12ba6349f0128ce40a54dcb0 (patch)
tree3625d003098afafe1e6c5aace35df986a0b67878 /bin
parent2b4ebc0839b2b3ae82b8db429e7dbc6e78ae7fad (diff)
pkg: vcs_upgrade: Pull currently checked out branch
Diffstat (limited to 'bin')
-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 {