summaryrefslogtreecommitdiff
path: root/src/checkout.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2017-10-07 12:23:33 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2017-10-07 12:32:04 +0100
commit128c5ca930fb30fff36e1eb5ff95c61ecd074edf (patch)
tree1c3355ddaf6678fe61e3087229c4e0efc1279af0 /src/checkout.c
parent752b7c792d7e2aad7be43a88114552233c230780 (diff)
downloadlibgit2-128c5ca930fb30fff36e1eb5ff95c61ecd074edf.tar.gz
checkout: do not test file mode on Windows
On Windows, we do not support file mode changes, so do not test for type changes between the disk and tree being checked out. We could have false positives since the on-disk file can only have an (effective) mode of 0100644 since NTFS does not support executable files. If the tree being checked out did have an executable file, we would erroneously decide that the file on disk had been changed.
Diffstat (limited to 'src/checkout.c')
-rw-r--r--src/checkout.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/checkout.c b/src/checkout.c
index 61c85ceae..caed6cdf1 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -161,7 +161,15 @@ GIT_INLINE(bool) is_workdir_base_or_new(
GIT_INLINE(bool) is_file_mode_changed(git_filemode_t a, git_filemode_t b)
{
+#ifdef GIT_WIN32
+ /*
+ * On Win32 we do not support the executable bit; the file will
+ * always be 0100644 on disk, don't bother doing a test.
+ */
+ return false;
+#else
return (S_ISREG(a) && S_ISREG(b) && a != b);
+#endif
}
static bool checkout_is_workdir_modified(