git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] notes: fix malformed tree entry
@ 2010-02-25  5:58 Junio C Hamano
  2010-02-25 11:31 ` Johan Herland
  0 siblings, 1 reply; 2+ messages in thread
From: Junio C Hamano @ 2010-02-25  5:58 UTC (permalink / raw)
  To: git; +Cc: Johan Herland

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>
---
 * This comes from 61a7cca (Notes API: write_notes_tree(): Store the notes
   tree in the database, 2010-02-13)

 notes.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/notes.c b/notes.c
index 3ba3e6d..a4f9926 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,
-- 
1.7.0.227.g2f3f2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] notes: fix malformed tree entry
  2010-02-25  5:58 [PATCH] notes: fix malformed tree entry Junio C Hamano
@ 2010-02-25 11:31 ` Johan Herland
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Herland @ 2010-02-25 11:31 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Thursday 25 February 2010, Junio C Hamano wrote:
> 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>

Acked-by: Johan Herland <johan@herland.net>

-- 
Johan Herland, <johan@herland.net>
www.herland.net

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-25 11:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-25  5:58 [PATCH] notes: fix malformed tree entry Junio C Hamano
2010-02-25 11:31 ` Johan Herland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).