diff options
Diffstat (limited to 't/t5710-info-alternate.sh')
| -rwxr-xr-x | t/t5710-info-alternate.sh | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/t/t5710-info-alternate.sh b/t/t5710-info-alternate.sh index 2e1b48a89b..5a6e49d18d 100755 --- a/t/t5710-info-alternate.sh +++ b/t/t5710-info-alternate.sh @@ -17,8 +17,8 @@ reachable_via() { } test_valid_repo() { - git fsck-objects --full > fsck.log && - test `wc -l < fsck.log` = 0 + git fsck --full > fsck.log && + test_line_count = 0 fsck.log } base_dir=`pwd` @@ -53,12 +53,18 @@ 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 && -test_valid_repo' +git clone --bare -l -s G H' + +test_expect_success 'invalidity of deepest repository' \ +'cd H && { + test_valid_repo + test $? -ne 0 +}' cd "$base_dir" @@ -75,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" @@ -95,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 - |
