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>

Brandon Williams committed May 30, 2017 at 10:30 UTC 55497b8c9e0163cb6d02cdf3b3cc3a10330c2b66
1 file changed +6 -6
diff-lib.c
+6 -6
@@ -101,7 +101,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
101 struct cache_entry *ce = active_cache[i];
102 int changed;
103 unsigned dirty_submodule = 0;
104 - const unsigned char *old_sha1, *new_sha1;
104 + const struct object_id *old_oid, *new_oid;
105
106 if (diff_can_quit_early(&revs->diffopt))
107 break;
@@ -233,12 +233,12 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
233 continue;
234 }
235 oldmode = ce->ce_mode;
236 - old_sha1 = ce->oid.hash;
237 - new_sha1 = changed ? null_sha1 : ce->oid.hash;
236 + old_oid = &ce->oid;
237 + new_oid = changed ? &null_oid : &ce->oid;
238 diff_change(&revs->diffopt, oldmode, newmode,
239 - old_sha1, new_sha1,
240 - !is_null_sha1(old_sha1),
241 - !is_null_sha1(new_sha1),
239 + old_oid->hash, new_oid->hash,
240 + !is_null_oid(old_oid),
241 + !is_null_oid(new_oid),
242 ce->name, 0, dirty_submodule);
243
244 }