Code

fetch-pack: Properly remove the shallow file when it becomes empty.
authorAlexandre Julliard <julliard@winehq.org>
Fri, 24 Nov 2006 14:58:04 +0000 (15:58 +0100)
committerJunio C Hamano <junkio@cox.net>
Fri, 24 Nov 2006 23:42:49 +0000 (15:42 -0800)
The code was unlinking the lock file instead.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
fetch-pack.c

index d00573d02215a3c5fc1a537ff3b84ce11e0e12fd..bb310b644f65116f96d711bd5a145acd2f10fa6a 100644 (file)
@@ -700,7 +700,7 @@ int main(int argc, char **argv)
 
                fd = hold_lock_file_for_update(&lock, shallow, 1);
                if (!write_shallow_commits(fd, 0)) {
-                       unlink(lock.filename);
+                       unlink(shallow);
                        rollback_lock_file(&lock);
                } else {
                        close(fd);