Thread (1 message) 1 message, 1 author, 2016-08-11
DORMANTno replies

[PATCH] Add comments to update_tree_entry()

From: Andy Parkins <hidden>
Date: 2016-08-11 20:15:55
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Andy Parkins <redacted>
---
 tree-walk.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/tree-walk.c b/tree-walk.c
index 14cc5ae..5363366 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -37,6 +37,11 @@ static void entry_extract(struct tree_desc *t, struct name_entry *a)
 
 void update_tree_entry(struct tree_desc *desc)
 {
+	/* Each tree is represented by a buffer containing hashes followed
+	 * by space followed by filename; separated with NUL.  To move to the
+	 * next entry we simply move forward by strlen() (which skips the filename)
+	 * then skip the hash and the space. */
+	/* This function should really be called skip_tree_entry() */
 	const void *buf = desc->buf;
 	unsigned long size = desc->size;
 	int len = strlen(buf) + 1 + 20;
-- 
1.4.4.1.geeee8
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help