# HG changeset patch
# User Manuel Jacob <me@manueljacob.de>
# Date 1583516527 -3600
#      Fri Mar 06 18:42:07 2020 +0100
# Node ID c30efdf3fcb9b5bf603a9ea427ffd6ab4915041c
# Parent  c7b17b2a433a351d489afa7a71194ca8f8ab84bf
hgrepo: forbid unicode tags

It was at some point planned to allow unicode tags (5d45e0edfa3f). This plan
was apparently discarded. To play safe, add an assert.

diff --git a/hggit/hgrepo.py b/hggit/hgrepo.py
--- a/hggit/hgrepo.py
+++ b/hggit/hgrepo.py
@@ -49,13 +49,11 @@
             (tags, tagtypes) = super(hgrepo, self)._findtags()
 
             for tag, rev in compat.iteritems(self.githandler.tags):
-                if isinstance(tag, unicode):
-                    tag = tag.encode('utf-8')
+                assert isinstance(tag, bytes)
                 tags[tag] = bin(rev)
                 tagtypes[tag] = b'git'
             for tag, rev in compat.iteritems(self.githandler.remote_refs):
-                if isinstance(tag, unicode):
-                    tag = tag.encode('utf-8')
+                assert isinstance(tag, bytes)
                 tags[tag] = rev
                 tagtypes[tag] = b'git-remote'
             tags.update(self.githandler.remote_refs)