summaryrefslogtreecommitdiff
path: root/tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-01-29 20:47:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-29 20:47:56 (GMT)
commit371820d5f1bb3c3e691ad21cee652c02c36ea758 (patch)
treead479bc8fd4e4c59c93807fe47355ef6fccf68e5 /tree.c
parenta6e3839976ed6328fccc83848c4f7c59d301edee (diff)
parent974e4a85e354d07fb4d50ff908713ecd5bcd4fff (diff)
downloadgit-371820d5f1bb3c3e691ad21cee652c02c36ea758.zip
git-371820d5f1bb3c3e691ad21cee652c02c36ea758.tar.gz
git-371820d5f1bb3c3e691ad21cee652c02c36ea758.tar.bz2
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.c')
-rw-r--r--tree.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tree.c b/tree.c
index 0b5c84d..9f0457c 100644
--- a/tree.c
+++ b/tree.c
@@ -86,7 +86,7 @@ static int read_tree_1(struct repository *r,
continue;
}
- switch (fn(entry.oid, base,
+ switch (fn(&entry.oid, base,
entry.path, entry.mode, stage, context)) {
case 0:
continue;
@@ -97,19 +97,19 @@ static int read_tree_1(struct repository *r,
}
if (S_ISDIR(entry.mode))
- oidcpy(&oid, entry.oid);
+ oidcpy(&oid, &entry.oid);
else if (S_ISGITLINK(entry.mode)) {
struct commit *commit;
- commit = lookup_commit(r, entry.oid);
+ commit = lookup_commit(r, &entry.oid);
if (!commit)
die("Commit %s in submodule path %s%s not found",
- oid_to_hex(entry.oid),
+ oid_to_hex(&entry.oid),
base->buf, entry.path);
if (parse_commit(commit))
die("Invalid commit %s in submodule path %s%s",
- oid_to_hex(entry.oid),
+ oid_to_hex(&entry.oid),
base->buf, entry.path);
oidcpy(&oid, get_commit_tree_oid(commit));