summaryrefslogtreecommitdiff
path: root/lockfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'lockfile.c')
-rw-r--r--lockfile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lockfile.c b/lockfile.c
index e148227fb1..c897dd8a93 100644
--- a/lockfile.c
+++ b/lockfile.c
@@ -301,6 +301,9 @@ int commit_lock_file(struct lock_file *lk)
{
char result_file[PATH_MAX];
+ if (!lk->filename[0])
+ die("BUG: attempt to commit unlocked object");
+
if (close_lock_file(lk))
return -1;