summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1127c51)
raw | patch | inline | side by side (parent: 1127c51)
author | Brandon Casey <casey@nrlssc.navy.mil> | |
Tue, 5 Aug 2008 18:01:50 +0000 (13:01 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 6 Aug 2008 04:21:20 +0000 (21:21 -0700) |
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>
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>
builtin-fsck.c | patch | blob | history | |
builtin-prune.c | patch | blob | history |
diff --git a/builtin-fsck.c b/builtin-fsck.c
index 6eb7da88d3e8591a8c544acc61a42e00babff120..d3f3de9446a9184e9457fe4b743c4e43a9256597 100644 (file)
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
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);
}
diff --git a/builtin-prune.c b/builtin-prune.c
index 947de8cf258c73d8a327ef3a1daed417ba533f1b..c767a0ac8930166315c26d8ece2e72b4f1942d55 100644 (file)
--- a/builtin-prune.c
+++ b/builtin-prune.c
if (de->d_name[0] != '.')
break;
continue;
- case 14:
- if (prefixcmp(de->d_name, "tmp_obj_"))
- break;
- prune_tmp_object(path, de->d_name);
- continue;
case 38:
sprintf(name, "%02x", i);
memcpy(name+2, de->d_name, len+1);
prune_object(path, de->d_name, sha1);
continue;
}
+ if (!prefixcmp(de->d_name, "tmp_obj_")) {
+ prune_tmp_object(path, de->d_name);
+ continue;
+ }
fprintf(stderr, "bad sha1 file: %s/%s\n", path, de->d_name);
}
if (!show_only)