summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-06-02 00:47:51 -0500
committerEdward Thomson <ethomson@github.com>2016-06-02 02:36:46 -0500
commit046ec3c9d68d4a79ed7efb044d275c62e8a49873 (patch)
treef79e69c3a65f9380365d6f78542e74d8c6552aad
parent93de20b8d282e3747f4d28a6daaa792ce7128cc6 (diff)
downloadlibgit2-046ec3c9d68d4a79ed7efb044d275c62e8a49873.tar.gz
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.
-rw-r--r--src/index.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/index.c b/src/index.c
index 135bf9ff5..b1ee65ffe 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;