提交 c88f0cc7 编写于 作者: J Junio C Hamano

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: NJunio C Hamano <gitster@pobox.com>
上级 43a61b84
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册