jlab: Don't push empty commits

This commit is contained in:
Geoffrey Frogeye 2024-12-20 22:49:20 +01:00
parent 355b63cf73
commit 12074f6d2e
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8

View file

@ -250,7 +250,7 @@ elif sys.argv[1] == "push":
bookmark = current_bookmark()
if not bookmark:
raise RuntimeError("Couldn't find a current branch")
heads = jj.log("heads(@::)")
heads = jj.log("heads(ancestors(@::) ~ empty())")
if len(heads) != 1:
raise RuntimeError("Multiple heads") # Or none if something goes horribly wrong
head = heads[0]