summaryrefslogtreecommitdiff
path: root/tree-diff.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-05-30 10:31:07 -0700
committerJunio C Hamano <gitster@pobox.com>2017-06-05 11:23:58 +0900
commit0e72462fb403110461faa1b06369b5c989ded381 (patch)
tree6062c9c5c4020cf81b359e1acfb57482475f0b4d /tree-diff.c
parentfda94b416ed07988e645cec22bf61742d4dd5c95 (diff)
downloadgit-0e72462fb403110461faa1b06369b5c989ded381.tar.gz
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>
Diffstat (limited to 'tree-diff.c')
-rw-r--r--tree-diff.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tree-diff.c b/tree-diff.c
index 6a960f569c..467e381724 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -132,7 +132,7 @@ static int emit_diff_first_parent_only(struct diff_options *opt, struct combine_
*/
static struct combine_diff_path *path_appendnew(struct combine_diff_path *last,
int nparent, const struct strbuf *base, const char *path, int pathlen,
- unsigned mode, const unsigned char *sha1)
+ unsigned mode, const struct object_id *oid)
{
struct combine_diff_path *p;
size_t len = st_add(base->len, pathlen);
@@ -162,7 +162,7 @@ static struct combine_diff_path *path_appendnew(struct combine_diff_path *last,
memcpy(p->path + base->len, path, pathlen);
p->path[len] = 0;
p->mode = mode;
- hashcpy(p->oid.hash, sha1 ? sha1 : null_sha1);
+ oidcpy(&p->oid, oid ? oid : &null_oid);
return p;
}
@@ -221,7 +221,7 @@ static struct combine_diff_path *emit_path(struct combine_diff_path *p,
if (emitthis) {
int keep;
struct combine_diff_path *pprev = p;
- p = path_appendnew(p, nparent, base, path, pathlen, mode, oid ? oid->hash : NULL);
+ p = path_appendnew(p, nparent, base, path, pathlen, mode, oid);
for (i = 0; i < nparent; ++i) {
/*