summaryrefslogtreecommitdiff
path: root/contrib/remote-helpers/test-hg-hg-git.sh
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-05-25 02:29:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-05-28 14:59:30 (GMT)
commit91347ea3e17b853155f9cab31f0c2a28143284ed (patch)
treeb75fa646c531d5224fb204ab90c0d728aa648b09 /contrib/remote-helpers/test-hg-hg-git.sh
parent63f54cf216944e8cadd7c762e624b0a7b1d0c3a2 (diff)
downloadgit-91347ea3e17b853155f9cab31f0c2a28143284ed.zip
git-91347ea3e17b853155f9cab31f0c2a28143284ed.tar.gz
git-91347ea3e17b853155f9cab31f0c2a28143284ed.tar.bz2
remote-hg: always point HEAD to master
Mercurial always checks out the 'default' branch, so there's no point in complicating our lives trying to do something fancier, which causes different behavior depending on whether the repository is local or remote. So let's always use 'default' (which we translate to 'master'), unless we are in hg-git mode, which expects us to use the 'master' bookmark instead. Also, update the tests that used to check for different checkout behaviors to simply check that the refs are there, remove unnecessary ones, and fix the ones that expect something different. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/remote-helpers/test-hg-hg-git.sh')
-rwxr-xr-xcontrib/remote-helpers/test-hg-hg-git.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.sh
index 37e59d8..2219284 100755
--- a/contrib/remote-helpers/test-hg-hg-git.sh
+++ b/contrib/remote-helpers/test-hg-hg-git.sh
@@ -27,7 +27,8 @@ fi
# clone to a git repo with git
git_clone_git () {
- git clone -q "hg::$1" $2
+ git clone -q "hg::$1" $2 &&
+ (cd $2 && git checkout master && git branch -D default)
}
# clone to an hg repo with git
@@ -63,6 +64,7 @@ hg_push_git () {
cd $2
git checkout -q -b tmp &&
git fetch -q "hg::../$1" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' &&
+ git branch -D default &&
git checkout -q @{-1} &&
git branch -q -D tmp 2> /dev/null || true
)