Skip to content

Commit c88f0cc

Browse files
committed
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 <[email protected]>
1 parent 43a61b8 commit c88f0cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

notes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,8 @@ static void write_tree_entry(struct strbuf *buf, unsigned int mode,
624624
const char *path, unsigned int path_len, const
625625
unsigned char *sha1)
626626
{
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);
629629
}
630630

631631
static void tree_write_stack_init_subtree(struct tree_write_stack *tws,

0 commit comments

Comments
 (0)