aboutsummaryrefslogtreecommitdiff
path: root/tree.h
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2026-01-09 22:30:13 +0100
committerJunio C Hamano <gitster@pobox.com>2026-01-09 18:36:16 -0800
commit2b74f68ca0553afcab3bed4b6971cf3bfd1fa7b2 (patch)
tree7ba37140ec926df19316374e103b30daac3b3511 /tree.h
parente691395365b871608551bfbe20982b53140a50f0 (diff)
downloadgit-2b74f68ca0553afcab3bed4b6971cf3bfd1fa7b2.tar.xz
tree: add repo_parse_tree*()
Add variants of parse_tree(), parse_tree_gently() and parse_tree_indirect() that allow using an arbitrary repository. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree.h')
-rw-r--r--tree.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/tree.h b/tree.h
index cc6ddf51b3..9037891d30 100644
--- a/tree.h
+++ b/tree.h
@@ -20,14 +20,22 @@ struct tree *lookup_tree(struct repository *r, const struct object_id *oid);
int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size);
int parse_tree_gently(struct tree *tree, int quiet_on_missing);
+int repo_parse_tree_gently(struct repository *r, struct tree *item,
+ int quiet_on_missing);
static inline int parse_tree(struct tree *tree)
{
return parse_tree_gently(tree, 0);
}
+static inline int repo_parse_tree(struct repository *r, struct tree *item)
+{
+ return repo_parse_tree_gently(r, item, 0);
+}
void free_tree_buffer(struct tree *tree);
/* Parses and returns the tree in the given ent, chasing tags and commits. */
struct tree *parse_tree_indirect(const struct object_id *oid);
+struct tree *repo_parse_tree_indirect(struct repository *r,
+ const struct object_id *oid);
/*
* Functions for comparing pathnames