diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2021-05-26 07:37:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-26 07:37:20 +0800 |
commit | 17643e0bd1b65155412ba5dba8f995a4f0080188 (patch) | |
tree | 81677cb062f30badff8ae37fbe05234d4d6908a7 /git/index/fun.py | |
parent | eae0e37c88a71a3b8ca816b820eed71fd1590f11 (diff) | |
parent | 1a04c15b1f77f908b1dd3983a27ee49c41b3a3e5 (diff) | |
download | gitpython-17643e0bd1b65155412ba5dba8f995a4f0080188.tar.gz |
Merge pull request #1254 from tmzullinger/index-mode-fix
improve index mode for executable files
Diffstat (limited to 'git/index/fun.py')
-rw-r--r-- | git/index/fun.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/git/index/fun.py b/git/index/fun.py index f40928c3..1012f480 100644 --- a/git/index/fun.py +++ b/git/index/fun.py @@ -11,6 +11,7 @@ from stat import ( S_ISDIR, S_IFMT, S_IFREG, + S_IXUSR, ) import subprocess @@ -115,7 +116,7 @@ def stat_mode_to_index_mode(mode): return S_IFLNK if S_ISDIR(mode) or S_IFMT(mode) == S_IFGITLINK: # submodules return S_IFGITLINK - return S_IFREG | 0o644 | (mode & 0o111) # blobs with or without executable bit + return S_IFREG | (mode & S_IXUSR and 0o755 or 0o644) # blobs with or without executable bit def write_cache(entries: Sequence[Union[BaseIndexEntry, 'IndexEntry']], stream: IO[bytes], |