diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-07-06 13:06:39 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-06 13:06:39 -0700 |
commit | c8b080af7108744299e26e8d38cb6587b933f9fc (patch) | |
tree | 4854d78f67e5235d1aced705af3169b4185e8aac /t | |
parent | 1f5d429e4a15e909214785e30bb81168932fdc54 (diff) | |
parent | 4e55ed32db81d06a4f618e2cc0f9da0e223ae304 (diff) | |
download | git-c8b080af7108744299e26e8d38cb6587b933f9fc.tar.gz git-c8b080af7108744299e26e8d38cb6587b933f9fc.tar.xz |
Merge branch 'et/add-chmod-x' into maint
"git update-index --add --chmod=+x file" may be usable as an escape
hatch, but not a friendly thing to force for people who do need to
use it regularly. "git add --chmod=+x file" can be used instead.
* et/add-chmod-x:
add: add --chmod=+x / --chmod=-x options
Diffstat (limited to 't')
-rwxr-xr-x | t/t3700-add.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t3700-add.sh b/t/t3700-add.sh index f14a66535..4865304eb 100755 --- a/t/t3700-add.sh +++ b/t/t3700-add.sh @@ -332,4 +332,34 @@ test_expect_success 'git add --dry-run --ignore-missing of non-existing file out test_i18ncmp expect.err actual.err ' +test_expect_success 'git add --chmod=+x stages a non-executable file with +x' ' + echo foo >foo1 && + git add --chmod=+x foo1 && + case "$(git ls-files --stage foo1)" in + 100755" "*foo1) echo pass;; + *) echo fail; git ls-files --stage foo1; (exit 1);; + esac +' + +test_expect_success 'git add --chmod=-x stages an executable file with -x' ' + echo foo >xfoo1 && + chmod 755 xfoo1 && + git add --chmod=-x xfoo1 && + case "$(git ls-files --stage xfoo1)" in + 100644" "*xfoo1) echo pass;; + *) echo fail; git ls-files --stage xfoo1; (exit 1);; + esac +' + +test_expect_success POSIXPERM,SYMLINKS 'git add --chmod=+x with symlinks' ' + git config core.filemode 1 && + git config core.symlinks 1 && + echo foo >foo2 && + git add --chmod=+x foo2 && + case "$(git ls-files --stage foo2)" in + 100755" "*foo2) echo pass;; + *) echo fail; git ls-files --stage foo2; (exit 1);; + esac +' + test_done |