rollback_lock_file(): do not clear filename redundantly
[gitweb.git] / lockfile.c
index d02c3bf901560d1e2bb021b23de7aae24bb45c0d..5330d6ae52ad6693c77fa31d24a51f7448597d34 100644 (file)
@@ -280,6 +280,6 @@ void rollback_lock_file(struct lock_file *lk)
                if (lk->fd >= 0)
                        close(lk->fd);
                unlink_or_warn(lk->filename);
+               lk->filename[0] = 0;
        }
-       lk->filename[0] = 0;
 }