summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f768846)
raw | patch | inline | side by side (parent: f768846)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sat, 9 Apr 2005 22:47:03 +0000 (15:47 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sat, 9 Apr 2005 22:47:03 +0000 (15:47 -0700) |
pathnames in them. We're migrating away from that.
This will cause tons of warnings for the current "sparse" archive,
but hell, better now than later.
This will cause tons of warnings for the current "sparse" archive,
but hell, better now than later.
fsck-cache.c | patch | blob | history |
diff --git a/fsck-cache.c b/fsck-cache.c
index 1123b6b7e4312a9ab47071479d071a5856fc8134..c35acaa82c93824f952327e12727d0c92edc5bd7 100644 (file)
--- a/fsck-cache.c
+++ b/fsck-cache.c
static int fsck_tree(unsigned char *sha1, void *data, unsigned long size)
{
+ int warn_old_tree = 1;
+
while (size) {
int len = 1+strlen(data);
unsigned char *file_sha1 = data + len;
unsigned int mode;
if (size < len + 20 || !path || sscanf(data, "%o", &mode) != 1)
return -1;
+
+ /* Warn about trees that don't do the recursive thing.. */
+ if (warn_old_tree && strchr(path, '/')) {
+ fprintf(stderr, "warning: fsck-cache: tree %s has full pathnames in it\n", sha1_to_hex(sha1));
+ warn_old_tree = 0;
+ }
+
data += len + 20;
size -= len + 20;
mark_needs_sha1(sha1, S_ISDIR(mode) ? "tree" : "blob", file_sha1);