[PATCH v2 07/48] remote-hg: test: simplify previous branch checkout
@{-1} does the same thing.Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
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.rc3.312.g47657de