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>
Junio C Hamano committed
Feb 24, 2010 at 21:39 UTC
c88f0cc78e2bd387c9a2a47973a3c0a3b6328fec
1 file changed
+2
-2
notes.c
+2
-2
@@ -624,8 +624,8 @@ static void write_tree_entry(struct strbuf *buf, unsigned int mode,
624
const char *path, unsigned int path_len, const
625
unsigned char *sha1)
626
{
627
- strbuf_addf(buf, "%06o %.*s%c", mode, path_len, path, '\0');
628
- strbuf_add(buf, sha1, 20);
627
+ strbuf_addf(buf, "%o %.*s%c", mode, path_len, path, '\0');
628
+ strbuf_add(buf, sha1, 20);
629
}
630
631
static void tree_write_stack_init_subtree(struct tree_write_stack *tws,