Skip to content

Commit 40412e0

Browse files
committed
preserve branch name of the form xxx/yyy when converting them into hg bookmarks
1 parent 3d8e3d9 commit 40412e0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

dulwich/repo.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,12 @@ def heads(self):
289289

290290
def remote_refs(self, remote_name):
291291
ret = {}
292-
for root, dirs, files in os.walk(os.path.join(self.controldir(), 'refs', 'remotes', remote_name)):
292+
r = os.path.join(self.controldir(), 'refs', 'remotes', remote_name)
293+
for root, dirs, files in os.walk(r):
293294
for name in files:
294-
ret[name] = self._get_ref(os.path.join(root, name))
295+
if root != r:
296+
name = root[len(r) + 1:] + "/" + name
297+
ret[name] = self._get_ref(os.path.join(r, name))
295298
return ret
296299

297300
def head(self):

0 commit comments

Comments
 (0)