Commit e755f79fd7b95ed58594b75bdf595b07c3b395f8

Edward Thomson 2016-06-02T00:47:51

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/index.c b/src/index.c
index 135bf9f..b1ee65f 100644
--- a/src/index.c
+++ b/src/index.c
@@ -2987,7 +2987,8 @@ int git_index_read_index(
 			/* Path and stage are equal, if the OID is equal, keep it to
 			 * 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;
 			} else {
 				dup_entry = (git_index_entry *)new_entry;