From f6f00b46aed220517df3c9808f81ea7ca9576643 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Fri, 24 May 2013 21:29:23 -0500 Subject: [PATCH] remote-hg: test: simplify previous branch checkout @{-1} does the same thing. Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- contrib/remote-helpers/test-hg-bidi.sh | 3 +-- contrib/remote-helpers/test-hg-hg-git.sh | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/contrib/remote-helpers/test-hg-bidi.sh b/contrib/remote-helpers/test-hg-bidi.sh index 1aadf35eb2..f0aa3c06c1 100755 --- a/contrib/remote-helpers/test-hg-bidi.sh +++ b/contrib/remote-helpers/test-hg-bidi.sh @@ -41,10 +41,9 @@ hg_clone () { hg_push () { ( cd $2 - old=$(git symbolic-ref --short HEAD) git checkout -q -b tmp && git fetch -q "hg::../$1" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' && - git checkout -q $old && + git checkout -q @{-1} && git branch -q -D tmp 2> /dev/null || true ) } diff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.sh index c2e7316385..37e59d8fe8 100755 --- a/contrib/remote-helpers/test-hg-hg-git.sh +++ b/contrib/remote-helpers/test-hg-hg-git.sh @@ -61,10 +61,9 @@ hg_clone_hg () { hg_push_git () { ( cd $2 - old=$(git symbolic-ref --short HEAD) git checkout -q -b tmp && git fetch -q "hg::../$1" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' && - git checkout -q $old && + git checkout -q @{-1} && git branch -q -D tmp 2> /dev/null || true ) } -- 2.11.4.GIT