Skip to content

Commit b963331

Browse files
committed
diff-files: fix incorrect usage of an empty tree
In c26022e (diff: convert diff_addremove to struct object_id, 2017-05-30), the OID to use for intent-to-add files was inadvertently changed from the empty blob to the empty tree. Let's revert that. To be able to do that, we just taught the regression test introduced in feea694 (diff-files: treat "i-t-a" files as "not-in-index", 2020-06-20) to _not_ expect the raw diff to contain the hash of the empty tree (we also had to fix the code to actually produce the expected output, but for the sake of this here patch, that's beside the point). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 640e225 commit b963331

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

diff-lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
234234
} else if (revs->diffopt.ita_invisible_in_index &&
235235
ce_intent_to_add(ce)) {
236236
diff_addremove(&revs->diffopt, '+', ce->ce_mode,
237-
the_hash_algo->empty_tree, 0,
237+
the_hash_algo->empty_blob, 0,
238238
ce->name, 0);
239239
continue;
240240
}

0 commit comments

Comments
 (0)