diff options
author | Graydon, Tracy <tracy.graydon@intel.com> | 2013-01-31 17:08:15 -0800 |
---|---|---|
committer | Graydon, Tracy <tracy.graydon@intel.com> | 2013-01-31 17:08:15 -0800 |
commit | 699fc9f67a9a62df492d1cd049e4978953640de9 (patch) | |
tree | f0c16f1494bd71922e7bf5258037427cac4a350b /t/t0004-unwritable.sh | |
download | git-699fc9f67a9a62df492d1cd049e4978953640de9.tar.gz git-699fc9f67a9a62df492d1cd049e4978953640de9.tar.bz2 git-699fc9f67a9a62df492d1cd049e4978953640de9.zip |
Initial commit for TizenHEADsubmit/2.0alpha/20130201.014617accepted/2.0alpha/20130201.0121062.0alpha
Diffstat (limited to 't/t0004-unwritable.sh')
-rwxr-xr-x | t/t0004-unwritable.sh | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/t/t0004-unwritable.sh b/t/t0004-unwritable.sh new file mode 100755 index 0000000..2342ac5 --- /dev/null +++ b/t/t0004-unwritable.sh @@ -0,0 +1,68 @@ +#!/bin/sh + +test_description='detect unwritable repository and fail correctly' + +. ./test-lib.sh + +test_expect_success setup ' + + >file && + git add file && + test_tick && + git commit -m initial && + echo >file && + git add file + +' + +test_expect_success POSIXPERM 'write-tree should notice unwritable repository' ' + + ( + chmod a-w .git/objects .git/objects/?? && + test_must_fail git write-tree + ) + status=$? + chmod 775 .git/objects .git/objects/?? + (exit $status) + +' + +test_expect_success POSIXPERM 'commit should notice unwritable repository' ' + + ( + chmod a-w .git/objects .git/objects/?? && + test_must_fail git commit -m second + ) + status=$? + chmod 775 .git/objects .git/objects/?? + (exit $status) + +' + +test_expect_success POSIXPERM 'update-index should notice unwritable repository' ' + + ( + echo 6O >file && + chmod a-w .git/objects .git/objects/?? && + test_must_fail git update-index file + ) + status=$? + chmod 775 .git/objects .git/objects/?? + (exit $status) + +' + +test_expect_success POSIXPERM 'add should notice unwritable repository' ' + + ( + echo b >file && + chmod a-w .git/objects .git/objects/?? && + test_must_fail git add file + ) + status=$? + chmod 775 .git/objects .git/objects/?? + (exit $status) + +' + +test_done |