diff options
Diffstat (limited to 'tree-walk.c')
-rw-r--r-- | tree-walk.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tree-walk.c b/tree-walk.c index ce27842439..24f9a0f14a 100644 --- a/tree-walk.c +++ b/tree-walk.c @@ -27,12 +27,14 @@ static void decode_tree_entry(struct tree_desc *desc, const char *buf, unsigned const char *path; unsigned int mode, len; - if (size < 24 || buf[size - 21]) - die("corrupt tree file"); + if (size < 23 || buf[size - 21]) + die(_("too-short tree object")); path = get_mode(buf, &mode); - if (!path || !*path) - die("corrupt tree file"); + if (!path) + die(_("malformed mode in tree entry for tree")); + if (!*path) + die(_("empty filename in tree entry for tree")); len = strlen(path) + 1; /* Initialize the descriptor entry */ @@ -81,7 +83,7 @@ void update_tree_entry(struct tree_desc *desc) unsigned long len = end - (const unsigned char *)buf; if (size < len) - die("corrupt tree file"); + die(_("too-short tree file")); buf = end; size -= len; desc->buffer = buf; |