diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-06-27 09:56:49 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-06-27 09:56:49 -0700 |
commit | c49fd57bf472143b1a0bbfb246c91e6ea0f06887 (patch) | |
tree | f2d6588d8302f18d43beb1e4f285f034e3c38513 /t | |
parent | 269085e16e26d5096b5458ae89d63eb27de26eb7 (diff) | |
parent | 4e55ed32db81d06a4f618e2cc0f9da0e223ae304 (diff) | |
download | git-c49fd57bf472143b1a0bbfb246c91e6ea0f06887.tar.gz git-c49fd57bf472143b1a0bbfb246c91e6ea0f06887.tar.xz |
Merge branch 'et/add-chmod-x'
"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 |