notes: fix malformed tree entry

The mode bits for entries in a tree object should be an octal number
with minimum number of digits.  Do not pad it with 0 to the left.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2010-02-24 21:39:06 -08:00
parent 43a61b841d
commit c88f0cc78e

View File

@ -624,7 +624,7 @@ static void write_tree_entry(struct strbuf *buf, unsigned int mode,
const char *path, unsigned int path_len, const
unsigned char *sha1)
{
strbuf_addf(buf, "%06o %.*s%c", mode, path_len, path, '\0');
strbuf_addf(buf, "%o %.*s%c", mode, path_len, path, '\0');
strbuf_add(buf, sha1, 20);
}