git: abort when attempting to set a branch
authorJosef 'Jeff' Sipek <jeffpc@josefsipek.net>
Thu, 26 Mar 2020 17:09:34 -0400
changeset 44622 7bbb83e4e8de
parent 44621 c5653cf2811d
child 44623 bb3e05ca21ca
git: abort when attempting to set a branch Given the mapping we use (namely, a git head is a bookmark), it is better to error out with a hint.
hgext/git/dirstate.py
--- a/hgext/git/dirstate.py	Thu Mar 26 16:23:54 2020 -0400
+++ b/hgext/git/dirstate.py	Thu Mar 26 17:09:34 2020 -0400
@@ -300,3 +300,8 @@
     def clearbackup(self, tr, backupname):
         # TODO
         pass
+
+    def setbranch(self, branch):
+        raise error.Abort(
+            b'git repos do not support branches. try using bookmarks'
+        )