Skip to content

Commit

Permalink
remote-hg: test: simplify previous branch checkout
Browse files Browse the repository at this point in the history
@{-1} does the same thing.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Felipe Contreras authored and Junio C Hamano committed May 28, 2013
1 parent 5f5e92f commit f6f00b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions contrib/remote-helpers/test-hg-bidi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
Expand Down
3 changes: 1 addition & 2 deletions contrib/remote-helpers/test-hg-hg-git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
Expand Down

0 comments on commit f6f00b4

Please sign in to comment.