Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit eb217db

Browse files
improve index mode for executable files
The fix for #430 in bebc4f5 (Use correct mode for executable files, 2016年05月19日) is incomplete. It fails (in most cases) when files have modes which are not exactly 0644 or 0755. As git only cares about executable or or not in this case, ensure the mode we set for the index is either 100644 or 100755. Do this similarly to how upstream git does it in cache.h1. Fixes #1253 1 https://github.com/git/git/blob/v2.31.1/cache.h#L247
1 parent ea43def commit eb217db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎git/index/fun.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
S_ISDIR,
1111
S_IFMT,
1212
S_IFREG,
13+
S_IXUSR,
1314
)
1415
import subprocess
1516

@@ -103,7 +104,7 @@ def stat_mode_to_index_mode(mode):
103104
return S_IFLNK
104105
if S_ISDIR(mode) or S_IFMT(mode) == S_IFGITLINK: # submodules
105106
return S_IFGITLINK
106-
return S_IFREG | 0o644|(mode & 0o111) # blobs with or without executable bit
107+
return S_IFREG | (mode & S_IXUSRand0o755or0o644) # blobs with or without executable bit
107108

108109

109110
def write_cache(entries, stream, extension_data=None, ShaStreamCls=IndexFileSHA1Writer):

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /