From: Felipe Contreras Date: Tue, 14 May 2013 04:36:38 GMT Subject: [PATCH 15/47] remote-hg: test: simplify previous branch checkout Message-ID: <1368506230-19614-16-git-send-email-felipe.contreras@gmail.com> In-Reply-To: <1368506230-19614-1-git-send-email-felipe.contreras@gmail.com> @{-1} does the same thing. Signed-off-by: Felipe Contreras --- 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 4bfbda2..88a33e6 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 274a8d5..e503293 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 ) } -- 1.8.3.rc1.579.g184e698