Merge branch 'js/info-man-path'
[gitweb.git] / t / t5710-info-alternate.sh
index c30fee81f5eb282798b6ca4abc4bd777f262080a..ef7127c1b3943a494692ac8027ec321608a31b9c 100755 (executable)
@@ -17,7 +17,7 @@ reachable_via() {
 }
 
 test_valid_repo() {
-       git fsck-objects --full > fsck.log &&
+       git fsck --full > fsck.log &&
        test `wc -l < fsck.log` = 0
 }
 
@@ -29,7 +29,7 @@ echo "Hello World" > file1 &&
 git add file1 &&
 git commit -m "Initial commit" file1 &&
 git repack -a -d &&
-git prune --grace=off'
+git prune'
 
 cd "$base_dir"
 
@@ -39,7 +39,7 @@ echo "foo bar" > file2 &&
 git add file2 &&
 git commit -m "next commit" file2 &&
 git repack -a -d -l &&
-git prune --grace=off'
+git prune'
 
 cd "$base_dir"
 
@@ -49,18 +49,22 @@ echo "Goodbye, cruel world" > file3 &&
 git add file3 &&
 git commit -m "one more" file3 &&
 git repack -a -d -l &&
-git prune --grace=off'
+git prune'
 
 cd "$base_dir"
 
-test_expect_failure 'creating too deep nesting' \
+test_expect_success 'creating too deep nesting' \
 'git clone -l -s C D &&
 git clone -l -s D E &&
 git clone -l -s E F &&
 git clone -l -s F G &&
-git clone -l -s G H &&
-cd H &&
-test_valid_repo'
+git clone -l -s G H'
+
+test_expect_success 'invalidity of deepest repository' \
+'cd H && {
+       test_valid_repo
+       test $? -ne 0
+}'
 
 cd "$base_dir"
 
@@ -77,16 +81,16 @@ test_valid_repo'
 cd "$base_dir"
 
 test_expect_success 'breaking of loops' \
-"echo '$base_dir/B/.git/objects' >> '$base_dir'/A/.git/objects/info/alternates&&
+'echo "$base_dir"/B/.git/objects >> "$base_dir"/A/.git/objects/info/alternates&&
 cd C &&
-test_valid_repo"
+test_valid_repo'
 
 cd "$base_dir"
 
-test_expect_failure 'that info/alternates is necessary' \
+test_expect_success 'that info/alternates is necessary' \
 'cd C &&
-rm .git/objects/info/alternates &&
-test_valid_repo'
+rm -f .git/objects/info/alternates &&
+! (test_valid_repo)'
 
 cd "$base_dir"
 
@@ -97,11 +101,12 @@ test_valid_repo'
 
 cd "$base_dir"
 
-test_expect_failure 'that relative alternate is only possible for current dir' \
-'cd D &&
-test_valid_repo'
+test_expect_success \
+    'that relative alternate is only possible for current dir' '
+    cd D &&
+    ! (test_valid_repo)
+'
 
 cd "$base_dir"
 
 test_done
-