summaryrefslogtreecommitdiff
path: root/tree-walk.h
diff options
context:
space:
mode:
Diffstat (limited to 'tree-walk.h')
-rw-r--r--tree-walk.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/tree-walk.h b/tree-walk.h
index a505846..0b1067f 100644
--- a/tree-walk.h
+++ b/tree-walk.h
@@ -1,9 +1,10 @@
#ifndef TREE_WALK_H
#define TREE_WALK_H
-#include "cache.h"
+#include "hash-ll.h"
-#define MAX_TRAVERSE_TREES 8
+struct index_state;
+struct repository;
/**
* The tree walking API is used to traverse and inspect trees.
@@ -23,6 +24,7 @@ struct name_entry {
* A semi-opaque data structure used to maintain the current state of the walk.
*/
struct tree_desc {
+ const struct git_hash_algo *algo;
/*
* pointer into the memory representation of the tree. It always
* points at the current entry being visited.
@@ -34,6 +36,11 @@ struct tree_desc {
/* counts the number of bytes left in the `buffer`. */
unsigned int size;
+
+ /* option flags passed via init_tree_desc_gently() */
+ enum tree_desc_flags {
+ TREE_DESC_RAW_MODES = (1 << 0),
+ } flags;
};
/**
@@ -77,9 +84,12 @@ int update_tree_entry_gently(struct tree_desc *);
* size parameters are assumed to be the same as the buffer and size
* members of `struct tree`.
*/
-void init_tree_desc(struct tree_desc *desc, const void *buf, unsigned long size);
+void init_tree_desc(struct tree_desc *desc, const struct object_id *tree_oid,
+ const void *buf, unsigned long size);
-int init_tree_desc_gently(struct tree_desc *desc, const void *buf, unsigned long size);
+int init_tree_desc_gently(struct tree_desc *desc, const struct object_id *oid,
+ const void *buf, unsigned long size,
+ enum tree_desc_flags flags);
/*
* Visit the next entry in a tree. Returns 1 when there are more entries
@@ -215,7 +225,7 @@ enum interesting {
enum interesting tree_entry_interesting(struct index_state *istate,
const struct name_entry *,
- struct strbuf *, int,
+ struct strbuf *,
const struct pathspec *ps);
#endif