summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2014-04-29 04:04:35 -0500
committerJunio C Hamano <gitster@pobox.com>2014-04-29 14:10:19 -0700
commiteef8aaa061129c6a367985ae0f5c5c42b84eda70 (patch)
tree8411b237a0231275c541153a858d76b88b44297b
parent78a2db2ae4617ad28a30899330b320c4c9af2024 (diff)
downloadgit-fc/remote-helpers-hg-bzr-graduation.tar.gz
remote-hg: trivial cleanupsfc/remote-helpers-hg-bzr-graduation
Cleanup 51be46e (remote-hg: do not fail on invalid bookmarks). Having a 40-characters string is not ideal, and having three tests for basically the same relatively rare situation is overkill. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-remote-hg.py2
-rwxr-xr-xt/t5810-remote-hg.sh56
2 files changed, 5 insertions, 53 deletions
diff --git a/git-remote-hg.py b/git-remote-hg.py
index 402b92f61c..74f2a2e1fb 100755
--- a/git-remote-hg.py
+++ b/git-remote-hg.py
@@ -677,7 +677,7 @@ def do_list(parser):
print "? refs/heads/branches/%s" % gitref(branch)
for bmark in bmarks:
- if bmarks[bmark].hex() == '0000000000000000000000000000000000000000':
+ if bmarks[bmark].hex() == '0' * 40:
warn("Ignoring invalid bookmark '%s'", bmark)
else:
print "? refs/heads/%s" % gitref(bmark)
diff --git a/t/t5810-remote-hg.sh b/t/t5810-remote-hg.sh
index ba8b2d89ed..9946f57e5b 100755
--- a/t/t5810-remote-hg.sh
+++ b/t/t5810-remote-hg.sh
@@ -772,7 +772,7 @@ test_expect_success 'remote double failed push' '
)
'
-test_expect_success 'clone remote with master null bookmark, then push to the bookmark' '
+test_expect_success 'clone remote with null bookmark, then push' '
test_when_finished "rm -rf gitrepo* hgrepo*" &&
hg init hgrepo &&
@@ -781,67 +781,19 @@ test_expect_success 'clone remote with master null bookmark, then push to the bo
echo a >a &&
hg add a &&
hg commit -m a &&
- hg bookmark -r null master
+ hg bookmark -r null bookmark
) &&
git clone "hg::hgrepo" gitrepo &&
check gitrepo HEAD a &&
(
cd gitrepo &&
- git checkout --quiet -b master &&
- echo b >b &&
- git add b &&
- git commit -m b &&
- git push origin master
- )
-'
-
-test_expect_success 'clone remote with default null bookmark, then push to the bookmark' '
- test_when_finished "rm -rf gitrepo* hgrepo*" &&
-
- hg init hgrepo &&
- (
- cd hgrepo &&
- echo a >a &&
- hg add a &&
- hg commit -m a &&
- hg bookmark -r null -f default
- ) &&
-
- git clone "hg::hgrepo" gitrepo &&
- check gitrepo HEAD a &&
- (
- cd gitrepo &&
- git checkout --quiet -b default &&
- echo b >b &&
- git add b &&
- git commit -m b &&
- git push origin default
- )
-'
-
-test_expect_success 'clone remote with generic null bookmark, then push to the bookmark' '
- test_when_finished "rm -rf gitrepo* hgrepo*" &&
-
- hg init hgrepo &&
- (
- cd hgrepo &&
- echo a >a &&
- hg add a &&
- hg commit -m a &&
- hg bookmark -r null bmark
- ) &&
-
- git clone "hg::hgrepo" gitrepo &&
- check gitrepo HEAD a &&
- (
- cd gitrepo &&
- git checkout --quiet -b bmark &&
+ git checkout --quiet -b bookmark &&
git remote -v &&
echo b >b &&
git add b &&
git commit -m b &&
- git push origin bmark
+ git push origin bookmark
)
'