changeset 564:b3881fda3ce9

listkeys: simplify ref stripping expression Eliminate a find that would always return 0, based on an example in git_handler update_hg_bookmarks.
author David M. Carr <david@carrclan.us>
date Sun, 28 Oct 2012 20:32:42 -0400
parents af4d66e2bc6e
children 8c6dc6a6f5d8
files hggit/gitrepo.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/gitrepo.py
+++ b/hggit/gitrepo.py
@@ -62,7 +62,7 @@
                 newcommits = [bin(c) for c in commits]
                 b = overlayrepo(handler, newcommits, refs)
                 stripped_refs = dict([
-                    (ref[ref.find('refs/heads/')+11:], b.node(refs[ref]))
+                    (ref[11:], b.node(refs[ref]))
                         for ref in refs.keys()
                             if ref.startswith('refs/heads/')])
                 return stripped_refs