aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-04-24 21:50:48 -0700
committerJunio C Hamano <gitster@pobox.com>2008-04-24 21:50:48 -0700
commit31c6390d40fe12a46c38d7224da61c6771886f2a (patch)
tree3856f02ce893c6254fcb0940ec57566ec385bb76 /t
parent3ffb58be0a779b47e1e4d3ea584ba301461a3a77 (diff)
parent3ef6a1fe95b0a5aaca21a86651850ef5d62327fa (diff)
downloadgit-31c6390d40fe12a46c38d7224da61c6771886f2a.tar.gz
git-31c6390d40fe12a46c38d7224da61c6771886f2a.tar.xz
Merge branch 'maint-1.5.4' into maint
* maint-1.5.4: t5516: remove ambiguity test (1) Linked glossary from cvs-migration page write-tree: properly detect failure to write tree objects
Diffstat (limited to 't')
-rwxr-xr-xt/t0004-unwritable.sh67
-rwxr-xr-xt/t5516-fetch-push.sh14
2 files changed, 68 insertions, 13 deletions
diff --git a/t/t0004-unwritable.sh b/t/t0004-unwritable.sh
new file mode 100755
index 000000000..9255c63c0
--- /dev/null
+++ b/t/t0004-unwritable.sh
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+test_description='detect unwritable repository and fail correctly'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+
+ >file &&
+ git add file &&
+ git commit -m initial &&
+ echo >file &&
+ git add file
+
+'
+
+test_expect_success 'write-tree should notice unwritable repository' '
+
+ (
+ chmod a-w .git/objects
+ test_must_fail git write-tree
+ )
+ status=$?
+ chmod 775 .git/objects
+ (exit $status)
+
+'
+
+test_expect_success 'commit should notice unwritable repository' '
+
+ (
+ chmod a-w .git/objects
+ test_must_fail git commit -m second
+ )
+ status=$?
+ chmod 775 .git/objects
+ (exit $status)
+
+'
+
+test_expect_success 'update-index should notice unwritable repository' '
+
+ (
+ echo a >file &&
+ chmod a-w .git/objects
+ test_must_fail git update-index file
+ )
+ status=$?
+ chmod 775 .git/objects
+ (exit $status)
+
+'
+
+test_expect_success 'add should notice unwritable repository' '
+
+ (
+ echo b >file &&
+ chmod a-w .git/objects
+ test_must_fail git add file
+ )
+ status=$?
+ chmod 775 .git/objects
+ (exit $status)
+
+'
+
+test_done
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 6d7e73854..f93a100f8 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -209,19 +209,7 @@ test_expect_success 'push with weak ambiguity (2)' '
'
-test_expect_success 'push with ambiguity (1)' '
-
- mk_test remotes/origin/master remotes/frotz/master &&
- if git push testrepo master:master
- then
- echo "Oops, should have failed"
- false
- else
- check_push_result $the_first_commit remotes/origin/master remotes/frotz/master
- fi
-'
-
-test_expect_success 'push with ambiguity (2)' '
+test_expect_success 'push with ambiguity' '
mk_test heads/frotz tags/frotz &&
if git push testrepo master:frotz