tree-diff: convert path_appendnew to object_id

Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Williams committed May 30, 2017 at 10:31 UTC 0e72462fb403110461faa1b06369b5c989ded381
1 file changed +3 -3
tree-diff.c
+3 -3
@@ -132,7 +132,7 @@ static int emit_diff_first_parent_only(struct diff_options *opt, struct combine_
132 */
133 static struct combine_diff_path *path_appendnew(struct combine_diff_path *last,
134 int nparent, const struct strbuf *base, const char *path, int pathlen,
135 - unsigned mode, const unsigned char *sha1)
135 + unsigned mode, const struct object_id *oid)
136 {
137 struct combine_diff_path *p;
138 size_t len = st_add(base->len, pathlen);
@@ -162,7 +162,7 @@ static struct combine_diff_path *path_appendnew(struct combine_diff_path *last,
162 memcpy(p->path + base->len, path, pathlen);
163 p->path[len] = 0;
164 p->mode = mode;
165 - hashcpy(p->oid.hash, sha1 ? sha1 : null_sha1);
165 + oidcpy(&p->oid, oid ? oid : &null_oid);
166
167 return p;
168 }
@@ -221,7 +221,7 @@ static struct combine_diff_path *emit_path(struct combine_diff_path *p,
221 if (emitthis) {
222 int keep;
223 struct combine_diff_path *pprev = p;
224 - p = path_appendnew(p, nparent, base, path, pathlen, mode, oid ? oid->hash : NULL);
224 + p = path_appendnew(p, nparent, base, path, pathlen, mode, oid);
225
226 for (i = 0; i < nparent; ++i) {
227 /*