From: Tomas Carnecky Date: Sun, 03 Oct 2010 12:21:49 GMT Subject: [PATCH 4/6] Rename get_mode() to decode_tree_mode() and export it Message-ID: <1286108511-55876-4-git-send-email-tom@dbservice.com> In-Reply-To: <4CA86A12.6080905@dbservice.com> Other sources (fast-import-helper.c) may want to use this function to parse trees. Signed-off-by: Tomas Carnecky --- 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