diff: finish conversion for prepare_temp_file to struct object_id

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Brandon Williams 2017-05-30 10:30:52 -07:00 committed by Junio C Hamano
parent fb4a1c0dc8
commit 74014152be

4
diff.c
View file

@ -3030,13 +3030,13 @@ static struct diff_tempfile *prepare_temp_file(const char *name,
/* we can borrow from the file in the work tree */
temp->name = name;
if (!one->oid_valid)
sha1_to_hex_r(temp->hex, null_sha1);
oid_to_hex_r(temp->hex, &null_oid);
else
oid_to_hex_r(temp->hex, &one->oid);
/* Even though we may sometimes borrow the
* contents from the work tree, we always want
* one->mode. mode is trustworthy even when
* !(one->sha1_valid), as long as
* !(one->oid_valid), as long as
* DIFF_FILE_VALID(one).
*/
xsnprintf(temp->mode, sizeof(temp->mode), "%06o", one->mode);