Commit 128c5ca9 by Edward Thomson

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.
parent 752b7c79
......@@ -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(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment