summaryrefslogtreecommitdiff
path: root/src/checkout.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2015-06-19 08:32:26 -0700
committerEdward Thomson <ethomson@edwardthomson.com>2015-06-20 15:37:32 -0400
commit96dd171e34fbb89d5ff5eb320c00db82b9ed3942 (patch)
tree12a051e50a7ceb8a5f1f0de948a46890028432ed /src/checkout.c
parentfc6568021c301ff4ebefe22814498ba07fe60b9c (diff)
downloadlibgit2-96dd171e34fbb89d5ff5eb320c00db82b9ed3942.tar.gz
diff: preserve original mode in the index
When updating the index during a diff, preserve the original mode, which prevents us from dropping the mode to what we have interpreted as on our system (eg, what the working directory claims it to be, which may be a lie on some systems.)
Diffstat (limited to 'src/checkout.c')
-rw-r--r--src/checkout.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/checkout.c b/src/checkout.c
index fd2b19a95..2893c63de 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -211,7 +211,7 @@ static bool checkout_is_workdir_modified(
if (baseitem->size && wditem->file_size != baseitem->size)
return true;
- if (git_diff__oid_for_entry(&oid, data->diff, wditem, NULL) < 0)
+ if (git_diff__oid_for_entry(&oid, data->diff, wditem, wditem->mode, NULL) < 0)
return false;
/* Allow the checkout if the workdir is not modified *or* if the checkout