Patchwork D8227: hgit: use type_str instead of type for checking type of git objects

login
register
mail settings
Submitter phabricator
Date March 5, 2020, 2:39 p.m.
Message ID <differential-rev-PHID-DREV-uje4mvgdbosam3kihspb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/45501/
State New
Headers show

Comments

phabricator - March 5, 2020, 2:39 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  type returns a constant which were integers.
  
  https://www.pygit2.org/objects.html#pygit2.Object.type

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8227

AFFECTED FILES
  hgext/git/manifest.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel
phabricator - March 5, 2020, 3:03 p.m.
pulkit added a comment.
pulkit planned changes to this revision.


  I should add some tests.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8227/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8227

To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/git/manifest.py b/hgext/git/manifest.py
--- a/hgext/git/manifest.py
+++ b/hgext/git/manifest.py
@@ -172,7 +172,7 @@ 
         for te in tree:
             # TODO: can we prune dir walks with the matcher?
             realname = subdir + pycompat.fsencode(te.name)
-            if te.type == r'tree':
+            if te.type_str == r'tree':
                 for inner in self._walkonetree(
                     self._git_repo[te.id], match, realname + b'/'
                 ):