commit_lock_file(): die() if called for unlocked lockfile object
[gitweb.git] / lockfile.c
index e148227fb16c7e99b7a10e203cdf65f011823dea..c897dd8a9390b508ef23c7afbae46c0c40ae3e6d 100644 (file)
@@ -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;