We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2514df8 commit d40f423Copy full SHA for d40f423
1 file changed
bin/chmod-sh
@@ -5,7 +5,8 @@ set -euo pipefail
5
# both the working tree and the index, so Makefile recipes invoking
6
# pkg/**/*.sh do not break on a missing exec bit after fresh checkouts.
7
8
-for f in "$@"; do
9
- chmod +x "$f"
10
- git update-index --chmod=+x -- "$f"
+for file in "$@"; do
+ [[ -x "$file" ]] || chmod +x "$file"
+ mode=$(git ls-files --stage -- "$file" | awk '{print $1}')
11
+ [[ "$mode" == "100755" ]] || git update-index --chmod=+x -- "$file"
12
done
0 commit comments