Patchwork D10532: git: ensure all dirstate state values are bytes

login
register
mail settings
Submitter phabricator
Date April 29, 2021, 12:24 a.m.
Message ID <differential-rev-PHID-DREV-frsq3b3mzhdzz5mzi34e-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48850/
State Superseded
Headers show

Comments

phabricator - April 29, 2021, 12:24 a.m.
mharbison72 created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I'm not sure how this particular git status occurs, but after the fallout of
  issue 6510 and getting into the issue 6511 state where `git status` shows the
  files as modified in both the "to be committed" and "not staged" lists,
  `hg diff` was crashing in `workingctx.__contains__()`.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  hgext/git/dirstate.py

CHANGE DETAILS




To: mharbison72, durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/hgext/git/dirstate.py b/hgext/git/dirstate.py
--- a/hgext/git/dirstate.py
+++ b/hgext/git/dirstate.py
@@ -63,7 +63,7 @@ 
         pygit2.GIT_STATUS_WT_RENAMED: b'a',
         pygit2.GIT_STATUS_WT_TYPECHANGE: b'n',
         pygit2.GIT_STATUS_WT_UNREADABLE: b'?',
-        pygit2.GIT_STATUS_INDEX_MODIFIED | pygit2.GIT_STATUS_WT_MODIFIED: 'm',
+        pygit2.GIT_STATUS_INDEX_MODIFIED | pygit2.GIT_STATUS_WT_MODIFIED: b'm',
     }