From 108f8e96a20ebf2652c1e29491dbd568eef405bf Mon Sep 17 00:00:00 2001 From: Richard Bateman Date: Thu, 20 Jan 2011 22:11:01 -0700 Subject: [PATCH] Added PDC set-head for setting the HEAD ref on a remote branch that you have write access to --- contrib/adc/set-head | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 contrib/adc/set-head diff --git a/contrib/adc/set-head b/contrib/adc/set-head new file mode 100755 index 0000000..e66f460 --- /dev/null +++ b/contrib/adc/set-head @@ -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