Patchwork [3,of,5] git: don't yield paths for directories when walking

login
register
mail settings
Submitter Josef 'Jeff' Sipek
Date June 1, 2020, 3:32 p.m.
Message ID <e05b94be1ba0cd6e2ccd.1591025567@meili>
Download mbox | patch
Permalink /patch/46451/
State Accepted
Headers show

Comments

Josef 'Jeff' Sipek - June 1, 2020, 3:32 p.m.
# HG changeset patch
# User Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
# Date 1591018818 14400
#      Mon Jun 01 09:40:18 2020 -0400
# Node ID e05b94be1ba0cd6e2ccd9c1688a82ff3a8103a7e
# Parent  cb9f077123e7e204587b2b9146736ddcfb8d677d
git: don't yield paths for directories when walking

Patch

diff --git a/hgext/git/manifest.py b/hgext/git/manifest.py
--- a/hgext/git/manifest.py
+++ b/hgext/git/manifest.py
@@ -173,9 +173,8 @@  class gittreemanifest(object):
                     self._git_repo[te.id], match, realname + b'/'
                 ):
                     yield inner
-            if not match(realname):
-                continue
-            yield pycompat.fsencode(realname)
+            elif match(realname):
+                yield pycompat.fsencode(realname)
 
     def walk(self, match):
         # TODO: this is a very lazy way to merge in the pending