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:
parent
5f5e92fb79
commit
f6f00b46ae
2 changed files with 2 additions and 4 deletions
|
@ -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
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue