summaryrefslogtreecommitdiff
path: root/diff-lib.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-05-30 17:30:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-02 00:36:07 (GMT)
commit55497b8c9e0163cb6d02cdf3b3cc3a10330c2b66 (patch)
tree4e6ab314042b4fb5e800618411efba29b71d92b3 /diff-lib.c
parentc26022ea8f54649ed6b3b545dd3158907abe5d2c (diff)
downloadgit-55497b8c9e0163cb6d02cdf3b3cc3a10330c2b66.zip
git-55497b8c9e0163cb6d02cdf3b3cc3a10330c2b66.tar.gz
git-55497b8c9e0163cb6d02cdf3b3cc3a10330c2b66.tar.bz2
diff: convert run_diff_files to struct object_id
Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-lib.c')
-rw-r--r--diff-lib.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/diff-lib.c b/diff-lib.c
index 7984ff9..c82b07d 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -101,7 +101,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
struct cache_entry *ce = active_cache[i];
int changed;
unsigned dirty_submodule = 0;
- const unsigned char *old_sha1, *new_sha1;
+ const struct object_id *old_oid, *new_oid;
if (diff_can_quit_early(&revs->diffopt))
break;
@@ -233,12 +233,12 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
continue;
}
oldmode = ce->ce_mode;
- old_sha1 = ce->oid.hash;
- new_sha1 = changed ? null_sha1 : ce->oid.hash;
+ old_oid = &ce->oid;
+ new_oid = changed ? &null_oid : &ce->oid;
diff_change(&revs->diffopt, oldmode, newmode,
- old_sha1, new_sha1,
- !is_null_sha1(old_sha1),
- !is_null_sha1(new_sha1),
+ old_oid->hash, new_oid->hash,
+ !is_null_oid(old_oid),
+ !is_null_oid(new_oid),
ce->name, 0, dirty_submodule);
}