{"thread":{"id":"22813","subject":"[PATCH] notes: fix malformed tree entry","startedAt":"2010-02-25T05:58:12Z","lastAt":"2010-02-25T11:31:11Z","messageCount":2,"participants":["Junio C Hamano","Johan Herland"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"135654","messageId":"7vocjdkgaz.fsf@alter.siamese.dyndns.org","threadId":"22813","inReplyTo":null,"subject":"[PATCH] notes: fix malformed tree entry","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-25T05:58:12Z","receivedAt":"2010-02-25T05:58:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The mode bits for entries in a tree object should be an octal number\nwith minimum number of digits.  Do not pad it with 0 to the left.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n * This comes from 61a7cca (Notes API: write_notes_tree(): Store the notes\n   tree in the database, 2010-02-13)\n\n notes.c |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/notes.c b/notes.c\nindex 3ba3e6d..a4f9926 100644\n--- a/notes.c\n+++ b/notes.c\n@@ -624,8 +624,8 @@ static void write_tree_entry(struct strbuf *buf, unsigned int mode,\n \t\tconst char *path, unsigned int path_len, const\n \t\tunsigned char *sha1)\n {\n-\t\tstrbuf_addf(buf, \"%06o %.*s%c\", mode, path_len, path, '\\0');\n-\t\tstrbuf_add(buf, sha1, 20);\n+\tstrbuf_addf(buf, \"%o %.*s%c\", mode, path_len, path, '\\0');\n+\tstrbuf_add(buf, sha1, 20);\n }\n \n static void tree_write_stack_init_subtree(struct tree_write_stack *tws,\n-- \n1.7.0.227.g2f3f2\n"},{"id":"135671","messageId":"201002251231.11859.johan@herland.net","threadId":"22813","inReplyTo":"7vocjdkgaz.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] notes: fix malformed tree entry","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2010-02-25T11:31:11Z","receivedAt":"2010-02-25T11:31:11Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Thursday 25 February 2010, Junio C Hamano wrote:\n> The mode bits for entries in a tree object should be an octal number\n> with minimum number of digits.  Do not pad it with 0 to the left.\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nAcked-by: Johan Herland <johan@herland.net>\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"}]}