From 8dc486f1cd95a74c6590d309abe379d8eff7848e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 13 Mar 2009 07:15:36 +0100 Subject: pkg: For now, only support the master branch --- bin/pkg | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bin/pkg b/bin/pkg index af456bb..035cfab 100755 --- a/bin/pkg +++ b/bin/pkg @@ -238,7 +238,18 @@ function vcs_log { } function vcs_upgrade { - git pull + typeset IFS=$'\n' line + typeset branch + for line in $(git branch); { + [[ $line == \*\ * ]] && branch=${line#* } + } + if [[ $branch != master ]] { + warn "$1: The currently checked out branch is not master, but '$branch'" \ + "Currently, pkg can only operate on the branch master" \ + " -> skipping repo, please fix manually or report a bug" + return 1 + } + git pull $PKG_ROOT/${PWD:t} master vcs_fix_origin } @@ -257,8 +268,6 @@ function vcs_fix_origin { if [[ ! -r .git/remotes/origin && ! -r .git/refs/remotes/origin/HEAD ]] { fgrep '[remote "origin"]' .git/config &> /dev/null || git remote add origin $PKG_ROOT/${PWD:t} - git config branch.master.remote origin - git config branch.master.merge refs/heads/master } git remote update &> /dev/null } -- cgit v1.2.3