From: Junio C Hamano Date: Tue, 29 Jan 2019 20:47:56 +0000 (-0800) Subject: Merge branch 'bc/tree-walk-oid' X-Git-Tag: v2.21.0-rc0~60 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=371820d5f1bb3c3e691ad21cee652c02c36ea758;p=git 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 --- 371820d5f1bb3c3e691ad21cee652c02c36ea758 diff --cc tree-walk.h index eefd26bb62,08d349c54f..a4ad28ea5e --- a/tree-walk.h +++ b/tree-walk.h @@@ -1,12 -1,14 +1,12 @@@ #ifndef TREE_WALK_H #define TREE_WALK_H - struct index_state; - struct strbuf; + #include "cache.h" -struct strbuf; - struct name_entry { - const struct object_id *oid; + struct object_id oid; const char *path; + int pathlen; unsigned int mode; }; diff --cc tree.c index 0b5c84d0d7,7badea0009..9f0457c05a --- a/tree.c +++ b/tree.c @@@ -101,10 -99,10 +101,10 @@@ static int read_tree_1(struct repositor else if (S_ISGITLINK(entry.mode)) { struct commit *commit; - commit = lookup_commit(r, entry.oid); - commit = lookup_commit(the_repository, &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))