File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -105,16 +105,22 @@ static int is_executable(const char *name)
105
105
return 0 ;
106
106
107
107
#if defined(GIT_WINDOWS_NATIVE )
108
- /* On Windows we cannot use the executable bit. The executable
109
- * state is determined by extension only. We do this first
110
- * because with virus scanners opening an executeable for
111
- * reading is potentially expensive.
108
+ /*
109
+ * On Windows there is no executable bit. The file extension
110
+ * indicates whether it can be run as an executable, and Git
111
+ * has special-handling to detect scripts and launch them
112
+ * through the indicated script interpreter. We test for the
113
+ * file extension first because virus scanners may make
114
+ * opening an executable for reading expensive.
112
115
*/
113
116
if (ends_with (name , ".exe" ))
114
117
return S_IXUSR ;
115
118
116
- { /* now that we know it does not have an executable extension,
117
- peek into the file instead */
119
+ {
120
+ /*
121
+ * Now that we know it does not have an executable extension,
122
+ * peek into the file instead.
123
+ */
118
124
char buf [3 ] = { 0 };
119
125
int n ;
120
126
int fd = open (name , O_RDONLY );
You can’t perform that action at this time.
0 commit comments