changeset 45516:73a5aa5e1857

git: pass `id` attribute of `pygit2.Tree` object `pygit2`'s Repository object expects an instance of `Oid` to return the corresponding object, instead of the object itself. After this change and D9062, `hg commit -i` seems to work, unless it hits a case folding assertion (ie trying to add a file like `README.md`). Differential Revision: https://phab.mercurial-scm.org/D9068
author Connor Sheehan <sheehan@mozilla.com>
date Tue, 22 Sep 2020 09:06:09 -0400
parents 89f0d9f87701
children 2a68a5ec8dd0
files hgext/git/manifest.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/git/manifest.py	Wed Sep 16 12:13:46 2020 -0700
+++ b/hgext/git/manifest.py	Tue Sep 22 09:06:09 2020 -0400
@@ -322,7 +322,8 @@
             for part in comps:
                 parent = trees[full]
                 try:
-                    new = self._repo[parent[pycompat.fsdecode(part)]]
+                    parent_tree_id = parent[pycompat.fsdecode(part)].id
+                    new = self._repo[parent_tree_id]
                 except KeyError:
                     # new directory
                     new = None