diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-01-07 17:57:54 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-01-07 17:57:54 +0100 |
commit | ec173b864148f38f12ba6349f0128ce40a54dcb0 (patch) | |
tree | 3625d003098afafe1e6c5aace35df986a0b67878 /bin/pkg | |
parent | 2b4ebc0839b2b3ae82b8db429e7dbc6e78ae7fad (diff) |
pkg: vcs_upgrade: Pull currently checked out branch
Diffstat (limited to 'bin/pkg')
-rwxr-xr-x | bin/pkg | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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 { |