diff: convert diff_index_show_file 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 fcf2cfb54b6be34749feb6ffb50fe2bdd7bac8bc
1 file changed +5 -5
diff-lib.c
+5 -5
@@ -255,12 +255,12 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
255 static void diff_index_show_file(struct rev_info *revs,
256 const char *prefix,
257 const struct cache_entry *ce,
258 - const unsigned char *sha1, int sha1_valid,
258 + const struct object_id *oid, int oid_valid,
259 unsigned int mode,
260 unsigned dirty_submodule)
261 {
262 diff_addremove(&revs->diffopt, prefix[0], mode,
263 - sha1, sha1_valid, ce->name, dirty_submodule);
263 + oid->hash, oid_valid, ce->name, dirty_submodule);
264 }
265
266 static int get_stat_data(const struct cache_entry *ce,
@@ -315,7 +315,7 @@ static void show_new_file(struct rev_info *revs,
315 &dirty_submodule, &revs->diffopt) < 0)
316 return;
317
318 - diff_index_show_file(revs, "+", new, oid->hash, !is_null_oid(oid), mode, dirty_submodule);
318 + diff_index_show_file(revs, "+", new, oid, !is_null_oid(oid), mode, dirty_submodule);
319 }
320
321 static int show_modified(struct rev_info *revs,
@@ -332,7 +332,7 @@ static int show_modified(struct rev_info *revs,
332 &dirty_submodule, &revs->diffopt) < 0) {
333 if (report_missing)
334 diff_index_show_file(revs, "-", old,
335 - old->oid.hash, 1, old->ce_mode,
335 + &old->oid, 1, old->ce_mode,
336 0);
337 return -1;
338 }
@@ -426,7 +426,7 @@ static void do_oneway_diff(struct unpack_trees_options *o,
426 * Something removed from the tree?
427 */
428 if (!idx) {
429 - diff_index_show_file(revs, "-", tree, tree->oid.hash, 1,
429 + diff_index_show_file(revs, "-", tree, &tree->oid, 1,
430 tree->ce_mode, 0);
431 return;
432 }