mercurial/commands.py
changeset 50090 a3c856e2ea2f
parent 50087 4fc6b423fa97
child 50091 a8d71a6ba205
--- a/mercurial/commands.py	Fri Jan 27 17:30:51 2023 +0100
+++ b/mercurial/commands.py	Fri Feb 17 17:04:41 2023 +0100
@@ -7500,6 +7500,9 @@
                 )
         node = logcmdutil.revsingle(repo, rev_).node()
 
+        if node is None:
+            raise error.InputError(_(b"cannot tag working directory"))
+
         if not message:
             # we don't translate commit messages
             message = b'Added tag %s for changeset %s' % (