dulwich-users team mailing list archive
-
dulwich-users team
-
Mailing list archive
-
Message #00672
[PATCH 08/13] server: Sort ref advertisements.
From: Dave Borowitz <dborowitz@xxxxxxxxxx>
C git does this, and the output of "git ls-remote" is surprising (to the
few users who use it) if unsorted.
Change-Id: I679c1205e75fdddce38331171e94a67c0f6de2de
---
dulwich/server.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dulwich/server.py b/dulwich/server.py
index 5cca17c..6f61336 100644
--- a/dulwich/server.py
+++ b/dulwich/server.py
@@ -337,7 +337,7 @@ class ProtocolGraphWalker(object):
return None
values = set(heads.itervalues())
if self.advertise_refs or not self.http_req:
- for i, (ref, sha) in enumerate(heads.iteritems()):
+ for i, (ref, sha) in enumerate(sorted(heads.iteritems())):
line = "%s %s" % (sha, ref)
if not i:
line = "%s\x00%s" % (line, self.handler.capability_line())
@@ -649,7 +649,7 @@ class ReceivePackHandler(Handler):
flush()
def handle(self):
- refs = self.repo.get_refs().items()
+ refs = sorted(self.repo.get_refs().iteritems())
if self.advertise_refs or not self.http_req:
if refs:
--
1.7.3.1
References