summaryrefslogtreecommitdiff
path: root/tree.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-11-30 09:05:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-12-01 19:32:29 (GMT)
commit6a0b0b6de996e2ac7eeb951e3d08f577c11c7e54 (patch)
treeb5ce77337d93903b5363e20694397efcb73daf25 /tree.h
parentb260d265e189728b26e50506ac6ffab6a7d588da (diff)
downloadgit-6a0b0b6de996e2ac7eeb951e3d08f577c11c7e54.zip
git-6a0b0b6de996e2ac7eeb951e3d08f577c11c7e54.tar.gz
git-6a0b0b6de996e2ac7eeb951e3d08f577c11c7e54.tar.bz2
tree.c: update read_tree_recursive callback to pass strbuf as base
This allows the callback to use 'base' as a temporary buffer to quickly assemble full path "without" extra allocation. The callback has to restore it afterwards of course. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree.h')
-rw-r--r--tree.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tree.h b/tree.h
index d84ac63..d24125f 100644
--- a/tree.h
+++ b/tree.h
@@ -4,6 +4,7 @@
#include "object.h"
extern const char *tree_type;
+struct strbuf;
struct tree {
struct object object;
@@ -22,7 +23,7 @@ void free_tree_buffer(struct tree *tree);
struct tree *parse_tree_indirect(const unsigned char *sha1);
#define READ_TREE_RECURSIVE 1
-typedef int (*read_tree_fn_t)(const unsigned char *, const char *, int, const char *, unsigned int, int, void *);
+typedef int (*read_tree_fn_t)(const unsigned char *, struct strbuf *, const char *, unsigned int, int, void *);
extern int read_tree_recursive(struct tree *tree,
const char *base, int baselen,