path: root/tree-walk.h
diff options
authorJunio C Hamano <>2019-01-29 20:47:56 (GMT)
committerJunio C Hamano <>2019-01-29 20:47:56 (GMT)
commit371820d5f1bb3c3e691ad21cee652c02c36ea758 (patch)
treead479bc8fd4e4c59c93807fe47355ef6fccf68e5 /tree-walk.h
parenta6e3839976ed6328fccc83848c4f7c59d301edee (diff)
parent974e4a85e354d07fb4d50ff908713ecd5bcd4fff (diff)
Merge branch 'bc/tree-walk-oid'
The code to walk tree objects has been taught that we may be working with object names that are not computed with SHA-1. * bc/tree-walk-oid: cache: make oidcpy always copy GIT_MAX_RAWSZ bytes tree-walk: store object_id in a separate member match-trees: use hashcpy to splice trees match-trees: compute buffer offset correctly when splicing tree-walk: copy object ID before use
Diffstat (limited to 'tree-walk.h')
1 files changed, 5 insertions, 5 deletions
diff --git a/tree-walk.h b/tree-walk.h
index eefd26b..a4ad28e 100644
--- a/tree-walk.h
+++ b/tree-walk.h
@@ -1,12 +1,12 @@
#ifndef TREE_WALK_H
#define TREE_WALK_H
-struct index_state;
-struct strbuf;
+#include "cache.h"
struct name_entry {
- const struct object_id *oid;
+ struct object_id oid;
const char *path;
+ int pathlen;
unsigned int mode;
@@ -20,12 +20,12 @@ static inline const struct object_id *tree_entry_extract(struct tree_desc *desc,
*pathp = desc->entry.path;
*modep = desc->entry.mode;
- return desc->entry.oid;
+ return &desc->entry.oid;
static inline int tree_entry_len(const struct name_entry *ne)
- return (const char *)ne->oid - ne->path - 1;
+ return ne->pathlen;