# HG changeset patch # User Anton Shestakov # Date 1656932512 -14400 # Node ID 3b8fce9a74df6a06d445cf9c33b974b79772965d # Parent 55adff8105464f6247983940ba109684d36b689d git: make sure to fsdecode bookmark names everywhere (issue6723) diff -r 55adff810546 -r 3b8fce9a74df hgext/git/__init__.py --- a/hgext/git/__init__.py Mon Jul 11 09:50:32 2022 +0200 +++ b/hgext/git/__init__.py Mon Jul 04 15:01:52 2022 +0400 @@ -204,7 +204,9 @@ @active.setter def active(self, mark): - githead = mark is not None and (_BMS_PREFIX + mark) or None + githead = None + if mark is not None: + githead = _BMS_PREFIX + pycompat.fsdecode(mark) if githead is not None and githead not in self.gitrepo.references: raise AssertionError(b'bookmark %s does not exist!' % mark) @@ -254,7 +256,7 @@ ) def checkconflict(self, mark, force=False, target=None): - githead = _BMS_PREFIX + mark + githead = _BMS_PREFIX + pycompat.fsdecode(mark) cur = self.gitrepo.references['HEAD'] if githead in self.gitrepo.references and not force: if target: diff -r 55adff810546 -r 3b8fce9a74df tests/test-git-interop.t --- a/tests/test-git-interop.t Mon Jul 11 09:50:32 2022 +0200 +++ b/tests/test-git-interop.t Mon Jul 04 15:01:52 2022 +0400 @@ -119,6 +119,10 @@ and bookmarks: $ hg bookmarks * master 1:3d9be8deba43 + $ hg up master + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg bookmarks + * master 1:3d9be8deba43 diff even works transparently in both systems: $ echo blah >> alpha