summaryrefslogtreecommitdiff
path: root/builtin-fsck.c
diff options
context:
space:
mode:
authorLibravatar Brandon Casey <casey@nrlssc.navy.mil>2008-08-05 13:01:50 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-08-05 21:21:20 -0700
commit3d32a46b247222a97007419fa865efce959b002d (patch)
treee4f7d85bf8a4acc5f1726f2881c2b848bb5d0320 /builtin-fsck.c
parentbash completion: Add completion for 'git mv' (diff)
downloadtgif-3d32a46b247222a97007419fa865efce959b002d.tar.xz
Teach fsck and prune that tmp_obj_ file names may not be 14 bytes long
As Shawn pointed out, not all temporary file creation routines can ensure that the generated temporary file is of a certain length. e.g. Java's createTempFile(prefix, suffix). So just depend on the prefix 'tmp_obj_' for detection. Update prune, and fix the "fix" introduced by a08c53a1 :) Signed-off-by: Brandon "appendixless" Casey <casey@nrlssc.navy.mil> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-fsck.c')
-rw-r--r--builtin-fsck.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-fsck.c b/builtin-fsck.c
index 6eb7da88d3..d3f3de9446 100644
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
@@ -385,7 +385,7 @@ static void fsck_dir(int i, char *path)
add_sha1_list(sha1, DIRENT_SORT_HINT(de));
continue;
}
- if (prefixcmp(de->d_name, "tmp_obj_"))
+ if (!prefixcmp(de->d_name, "tmp_obj_"))
continue;
fprintf(stderr, "bad sha1 file: %s/%s\n", path, de->d_name);
}