1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-01 14:57:52 +01:00

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>
This commit is contained in:
Felipe Contreras 2013-05-24 21:29:23 -05:00 committed by Junio C Hamano
parent 5f5e92fb79
commit f6f00b46ae
2 changed files with 2 additions and 4 deletions

View file

@ -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
)
}

View file

@ -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
)
}