diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2013-05-24 21:29:23 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-05-28 07:59:19 -0700 |
commit | f6f00b46aed220517df3c9808f81ea7ca9576643 (patch) | |
tree | adefe70eadb6512b382e8d4625dbe9e590e21868 /contrib/remote-helpers | |
parent | remote-helpers: test: simplify remote URLs (diff) | |
download | tgif-f6f00b46aed220517df3c9808f81ea7ca9576643.tar.xz |
remote-hg: test: simplify previous branch checkout
@{-1} does the same thing.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/remote-helpers')
-rwxr-xr-x | contrib/remote-helpers/test-hg-bidi.sh | 3 | ||||
-rwxr-xr-x | 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 ) } |