Added PDC set-head for setting the HEAD ref on a remote branch that you have write access to

This commit is contained in:
Richard Bateman 2011-01-20 22:11:01 -07:00 committed by Sitaram Chamarty
parent 2cbe807b34
commit 108f8e96a2

17
contrib/adc/set-head Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
. $(dirname $0)/adc.common-functions
[ -z "$GL_RC" ] && die "ENV GL_RC not set"
[ -z "$2" ] && die "usage: set-head /path/to/repo.git refs/heads/branchname"
get_rights_and_owner $1; to=$repo
[ -z "$perm_write" ] && die "no write permissions on $to"
# change head
cd $GL_REPO_BASE_ABS/$to.git
git symbolic-ref HEAD $2
echo HEAD on $to is `git symbolic-ref HEAD`
cd - > /dev/null