From 878646542f707d397d8c7c8e362176b0166148f4 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Thu, 7 Mar 2013 15:37:21 -0500 Subject: [PATCH] deploy-branch: Check out original ref by name if possible (imported from commit eefc68574f1d1a94f1284670df18f59ef2aa1aa5) --- tools/deploy-branch | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/deploy-branch b/tools/deploy-branch index 8b966378ff..5f2bc93557 100755 --- a/tools/deploy-branch +++ b/tools/deploy-branch @@ -19,7 +19,12 @@ branch_ref=$(git rev-list --max-count=1 $branch) if [ "$old_ref" == "$branch_ref" ]; then new_ref=master else - new_ref=$old_ref + ref_name=$(git describe --all --exact $old_ref) + if [ $? -eq 0 ]; then + new_ref=$(echo $ref_name | perl -pe 's{^(heads|remotes)/}{}') + else + new_ref=$old_ref + fi fi [ -z "$branch" ] && error_out "You must specify a branch name to deploy"