index_read_index: differentiate on mode

Treat index entries with different modes as different, which they
are, at least for the purposes of up-to-date calculations.
This commit is contained in:
Edward Thomson 2016-06-02 00:47:51 -05:00 committed by Carlos Martín Nieto
parent e6a0a85091
commit e755f79fd7

View File

@ -2987,7 +2987,8 @@ int git_index_read_index(
/* Path and stage are equal, if the OID is equal, keep it to /* Path and stage are equal, if the OID is equal, keep it to
* keep the stat cache data. * keep the stat cache data.
*/ */
if (git_oid_equal(&old_entry->id, &new_entry->id)) { if (git_oid_equal(&old_entry->id, &new_entry->id) &&
old_entry->mode == new_entry->mode) {
add_entry = (git_index_entry *)old_entry; add_entry = (git_index_entry *)old_entry;
} else { } else {
dup_entry = (git_index_entry *)new_entry; dup_entry = (git_index_entry *)new_entry;