From ec173b864148f38f12ba6349f0128ce40a54dcb0 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 7 Jan 2009 17:57:54 +0100 Subject: pkg: vcs_upgrade: Pull currently checked out branch --- bin/pkg | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'bin/pkg') 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 { -- cgit v1.2.3