summaryrefslogtreecommitdiff
path: root/contrib/remote-helpers
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-05-25 02:29:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-05-28 14:59:19 (GMT)
commitf6f00b46aed220517df3c9808f81ea7ca9576643 (patch)
treeadefe70eadb6512b382e8d4625dbe9e590e21868 /contrib/remote-helpers
parent5f5e92fb7954c0bd258563541fed394bc5f88544 (diff)
downloadgit-f6f00b46aed220517df3c9808f81ea7ca9576643.zip
git-f6f00b46aed220517df3c9808f81ea7ca9576643.tar.gz
git-f6f00b46aed220517df3c9808f81ea7ca9576643.tar.bz2
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-xcontrib/remote-helpers/test-hg-bidi.sh3
-rwxr-xr-xcontrib/remote-helpers/test-hg-hg-git.sh3
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 1aadf35..f0aa3c0 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 c2e7316..37e59d8 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
)
}