From: Junio C Hamano Date: Thu, 25 Feb 2010 05:39:06 +0000 (-0800) Subject: notes: fix malformed tree entry X-Git-Tag: v1.7.1-rc0~68^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c88f0cc78e2bd387c9a2a47973a3c0a3b6328fec;p=git.git 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 --- diff --git a/notes.c b/notes.c index 3ba3e6de1..a4f9926d4 100644 --- a/notes.c +++ b/notes.c @@ -624,8 +624,8 @@ 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_add(buf, sha1, 20); + strbuf_addf(buf, "%o %.*s%c", mode, path_len, path, '\0'); + strbuf_add(buf, sha1, 20); } static void tree_write_stack_init_subtree(struct tree_write_stack *tws,