summaryrefslogtreecommitdiff
path: root/fsck-cache.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-09 22:47:03 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-09 22:47:03 (GMT)
commit4e6616ab77ed6a53f857d4b1082c4dc4140f34f5 (patch)
tree10b554bd1513e33b7054c02eba9cda69bc29e187 /fsck-cache.c
parentf768846e34997fb847c9b875615867d4716d632f (diff)
downloadgit-4e6616ab77ed6a53f857d4b1082c4dc4140f34f5.zip
git-4e6616ab77ed6a53f857d4b1082c4dc4140f34f5.tar.gz
git-4e6616ab77ed6a53f857d4b1082c4dc4140f34f5.tar.bz2
Make fsck-cache warn about old-style tree objects that have full
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.
Diffstat (limited to 'fsck-cache.c')
-rw-r--r--fsck-cache.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fsck-cache.c b/fsck-cache.c
index 1123b6b..c35acaa 100644
--- a/fsck-cache.c
+++ b/fsck-cache.c
@@ -20,6 +20,8 @@ static int mark_sha1_seen(unsigned char *sha1, char *tag)
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;
@@ -27,6 +29,13 @@ static int fsck_tree(unsigned char *sha1, void *data, unsigned long size)
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);