Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx> --- contrib/remote-helpers/git-remote-hg | 19 +++++++++---------- contrib/remote-helpers/test-hg.sh | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index cacf2da..ff38fac 100755 --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@ -561,11 +561,11 @@ def get_branch_tip(repo, branch): def list_head(repo, cur): global g_head, bmarks - if 'default' not in repo: + if 'default' not in branches: # empty repo return - node = repo['default'] + node = repo[branch_tip('default')] head = 'master' if not 'master' in bmarks else 'default' bmarks[head] = node @@ -581,18 +581,17 @@ def do_list(parser): bmarks[bmark] = repo[node] cur = repo.dirstate.branch() + orig = peer if peer else repo + + for branch, heads in orig.branchmap().iteritems(): + # only open heads + heads = [h for h in heads if not repo[h].closesbranch()] + if heads: + branches[branch] = heads list_head(repo, cur) if track_branches: - orig = peer if peer else repo - - for branch, heads in orig.branchmap().iteritems(): - # only open heads - heads = [h for h in heads if not repo[h].closesbranch()] - if heads: - branches[branch] = heads - for branch in branches: print "? refs/heads/branches/%s" % gitref(branch) diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh index ecf7bd4..b3422c4 100755 --- a/contrib/remote-helpers/test-hg.sh +++ b/contrib/remote-helpers/test-hg.sh @@ -426,7 +426,7 @@ test_expect_success 'remote big push' ' check_bookmark hgrepo new_bmark '' ' -test_expect_failure 'remote double failed push' ' +test_expect_success 'remote double failed push' ' test_when_finished "rm -rf hgrepo gitrepo*" && ( -- 1.8.3.rc1.579.g184e698 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html