Other sources (fast-import-helper.c) may want to use this function to parse trees. Signed-off-by: Tomas Carnecky <tom@xxxxxxxxxxxxx> --- tree-walk.c | 4 ++-- tree-walk.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tree-walk.c b/tree-walk.c index a9bbf4e..5f51f4e 100644 --- a/tree-walk.c +++ b/tree-walk.c @@ -3,7 +3,7 @@ #include "unpack-trees.h" #include "tree.h" -static const char *get_mode(const char *str, unsigned int *modep) +const char *decode_tree_mode(const char *str, unsigned int *modep) { unsigned char c; unsigned int mode = 0; @@ -28,7 +28,7 @@ static void decode_tree_entry(struct tree_desc *desc, const char *buf, unsigned if (size < 24 || buf[size - 21]) die("corrupt tree file"); - path = get_mode(buf, &mode); + path = decode_tree_mode(buf, &mode); if (!path || !*path) die("corrupt tree file"); len = strlen(path) + 1; diff --git a/tree-walk.h b/tree-walk.h index 7e3e0b5..6bbde1c 100644 --- a/tree-walk.h +++ b/tree-walk.h @@ -13,6 +13,8 @@ struct tree_desc { unsigned int size; }; +const char *decode_tree_mode(const char *str, unsigned int *modep); + static inline const unsigned char *tree_entry_extract(struct tree_desc *desc, const char **pathp, unsigned int *modep) { *pathp = desc->entry.path; -- 1.7.3.37.gb6088b -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html