Fix inconsistency in handling of trailing slashes.
authorJelmer Vernooij <jelmer@jelmer.uk>
Sat, 31 Oct 2015 22:12:05 +0000 (22:12 +0000)
committerJelmer Vernooij <jelmer@jelmer.uk>
Sat, 31 Oct 2015 22:12:05 +0000 (22:12 +0000)
Thanks to Jonas Haag for reporting. (#383)

dulwich/refs.py

index bbbbf4aa9f37743ce0694088dbf10215208c4276..df3a32e2281ba1b1e81f9313ac90839c25c20e70 100644 (file)
@@ -149,6 +149,8 @@ class RefsContainer(object):
         keys = self.keys(base)
         if base is None:
             base = b''
+        else:
+            base = base.rstrip(b'/')
         for key in keys:
             try:
                 ret[key] = self[(base + b'/' + key).strip(b'/')]