path: root/cache-tree.c
diff options
authorLinus Torvalds <>2009-07-14 18:25:17 (GMT)
committerJunio C Hamano <>2009-07-14 20:50:33 (GMT)
commita38837341c995773f2adc29ff5971196187b07fb (patch)
tree934f2190c3ad1b64f6b609a0625e85acb6b0df53 /cache-tree.c
parentf222abdeec7838891e79abd152c6cb67e532b68d (diff)
Improve on the 'invalid object' error message at commit time
Not that anybody should ever get it, but somebody did (probably because of a flaky filesystem, but whatever). And each time I see an error message that I haven't seen before, I decide that next time it will look better. So this makes us write more relevant information about exactly which file ended up having issues with a missing object. Which will tell whether it was a tree object, for example, or just a regular file in the index (and which one). Signed-off-by: Linus Torvalds <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'cache-tree.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/cache-tree.c b/cache-tree.c
index 16a65df..d917437 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -329,7 +329,8 @@ static int update_one(struct cache_tree *it,
entlen = pathlen - baselen;
if (mode != S_IFGITLINK && !missing_ok && !has_sha1_file(sha1))
- return error("invalid object %s", sha1_to_hex(sha1));
+ return error("invalid object %06o %s for '%.*s'",
+ mode, sha1_to_hex(sha1), entlen+baselen, path);
if (ce->ce_flags & CE_REMOVE)
continue; /* entry being removed */