path: root/tree-walk.h
diff options
authorJeff King <>2019-07-31 04:38:20 (GMT)
committerJunio C Hamano <>2019-08-01 20:06:52 (GMT)
commitb3b3cbcbf246b1051ad453bc02e24a89573e2911 (patch)
tree3de6ade42d5a43eca2da12cd6053c57d0c4c66b5 /tree-walk.h
parent37806080d7be1ab5b2fa918f6a528652596ea2c1 (diff)
tree-walk: accept a raw length for traverse_path_len()
We take a "struct name_entry", but only care about the length of the path name. Let's just take that length directly, making it easier to use the function from callers that sometimes do not have a name_entry at all. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'tree-walk.h')
1 files changed, 3 insertions, 2 deletions
diff --git a/tree-walk.h b/tree-walk.h
index 47bf85d..a25c751 100644
--- a/tree-walk.h
+++ b/tree-walk.h
@@ -74,9 +74,10 @@ char *make_traverse_path(char *path, const struct traverse_info *info,
const char *name, size_t namelen);
void setup_traverse_info(struct traverse_info *info, const char *base);
-static inline size_t traverse_path_len(const struct traverse_info *info, const struct name_entry *n)
+static inline size_t traverse_path_len(const struct traverse_info *info,
+ size_t namelen)
- return st_add(info->pathlen, tree_entry_len(n));
+ return st_add(info->pathlen, namelen);
/* in general, positive means "kind of interesting" */