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>
Felipe Contreras committed
May 24, 2013 at 21:29 UTC
f6f00b46aed220517df3c9808f81ea7ca9576643
2 files changed
+2
-4
contrib/remote-helpers/test-hg-bidi.sh
+1
-2
@@ -41,10 +41,9 @@ hg_clone () {
41
hg_push () {
42
(
43
cd $2
44
- old=$(git symbolic-ref --short HEAD)
44
git checkout -q -b tmp &&
45
git fetch -q "hg::../$1" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' &&
47
- git checkout -q $old &&
46
+ git checkout -q @{-1} &&
47
git branch -q -D tmp 2> /dev/null || true
48
)
49
}
contrib/remote-helpers/test-hg-hg-git.sh
+1
-2
@@ -61,10 +61,9 @@ hg_clone_hg () {
61
hg_push_git () {
62
(
63
cd $2
64
- old=$(git symbolic-ref --short HEAD)
64
git checkout -q -b tmp &&
65
git fetch -q "hg::../$1" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' &&
67
- git checkout -q $old &&
66
+ git checkout -q @{-1} &&
67
git branch -q -D tmp 2> /dev/null || true
68
)
69
}