summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-03-13 07:15:36 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2009-03-13 07:15:36 +0100
commit8dc486f1cd95a74c6590d309abe379d8eff7848e (patch)
treeb7d99ac5879c733a8f008d09caafb73d6e97042a
parent6128bd5f70e26e5300013599428c7253e046d46b (diff)
pkg: For now, only support the master branch
-rwxr-xr-xbin/pkg15
1 files 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
}