checkout: avoid unnecessary match_pathspec calls
[gitweb.git] / t / t5710-info-alternate.sh
index 1908dc8b06aa5a5d217d70c26f64c3700d593be0..aa045295dec5af9dedc25495668d4afd6022d2cd 100755 (executable)
@@ -18,7 +18,7 @@ reachable_via() {
 
 test_valid_repo() {
        git fsck --full > fsck.log &&
-       test `wc -l < fsck.log` = 0
+       test_line_count = 0 fsck.log
 }
 
 base_dir=`pwd`
@@ -81,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"
 
@@ -101,9 +101,11 @@ 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"