Browse Source

Merge branch 'jc/clean-after-sanity-tests'

test cleanup.

* jc/clean-after-sanity-tests:
  tests: clean after SANITY tests
maint
Junio C Hamano 7 years ago
parent
commit
18404434bf
  1. 1
      t/t0001-init.sh
  2. 2
      t/t0070-fundamental.sh
  3. 6
      t/t1004-read-tree-m-u-wf.sh
  4. 2
      t/t5537-fetch-shallow.sh
  5. 4
      t/t7508-status.sh

1
t/t0001-init.sh

@ -287,6 +287,7 @@ test_expect_success 'init notices EEXIST (2)' ' @@ -287,6 +287,7 @@ test_expect_success 'init notices EEXIST (2)' '
'

test_expect_success POSIXPERM,SANITY 'init notices EPERM' '
test_when_finished "chmod +w newdir" &&
rm -fr newdir &&
mkdir newdir &&
chmod -w newdir &&

2
t/t0070-fundamental.sh

@ -19,8 +19,8 @@ test_expect_success 'mktemp to nonexistent directory prints filename' ' @@ -19,8 +19,8 @@ test_expect_success 'mktemp to nonexistent directory prints filename' '

test_expect_success POSIXPERM,SANITY 'mktemp to unwritable directory prints filename' '
mkdir cannotwrite &&
chmod -w cannotwrite &&
test_when_finished "chmod +w cannotwrite" &&
chmod -w cannotwrite &&
test_must_fail test-tool mktemp cannotwrite/testXXXXXX 2>err &&
grep "cannotwrite/test" err
'

6
t/t1004-read-tree-m-u-wf.sh

@ -179,6 +179,8 @@ test_expect_success 'funny symlink in work tree' ' @@ -179,6 +179,8 @@ test_expect_success 'funny symlink in work tree' '

test_expect_success SANITY 'funny symlink in work tree, un-unlink-able' '

test_when_finished "chmod u+w a 2>/dev/null; rm -fr a b" &&

rm -fr a b &&
git reset --hard &&

@ -188,10 +190,6 @@ test_expect_success SANITY 'funny symlink in work tree, un-unlink-able' ' @@ -188,10 +190,6 @@ test_expect_success SANITY 'funny symlink in work tree, un-unlink-able' '

'

# clean-up from the above test
chmod a+w a 2>/dev/null
rm -fr a b

test_expect_success 'D/F setup' '

git reset --hard &&

2
t/t5537-fetch-shallow.sh

@ -175,8 +175,8 @@ EOF @@ -175,8 +175,8 @@ EOF

test_expect_success POSIXPERM,SANITY 'shallow fetch from a read-only repo' '
cp -R .git read-only.git &&
find read-only.git -print | xargs chmod -w &&
test_when_finished "find read-only.git -type d -print | xargs chmod +w" &&
find read-only.git -print | xargs chmod -w &&
git clone --no-local --depth=2 read-only.git from-read-only &&
git --git-dir=from-read-only/.git log --format=%s >actual &&
cat >expect <<EOF &&

4
t/t7508-status.sh

@ -1099,6 +1099,7 @@ EOF @@ -1099,6 +1099,7 @@ EOF
'

test_expect_success POSIXPERM,SANITY 'status succeeds in a read-only repository' '
test_when_finished "chmod 775 .git" &&
(
chmod a-w .git &&
# make dir1/tracked stat-dirty
@ -1108,9 +1109,6 @@ test_expect_success POSIXPERM,SANITY 'status succeeds in a read-only repository' @@ -1108,9 +1109,6 @@ test_expect_success POSIXPERM,SANITY 'status succeeds in a read-only repository'
# make sure "status" succeeded without writing index out
git diff-files | grep dir1/tracked
)
status=$?
chmod 775 .git
(exit $status)
'

(cd sm && echo > bar && git add bar && git commit -q -m 'Add bar') && git add sm

Loading…
Cancel
Save