diff options
Diffstat (limited to 't/t1050-large.sh')
-rwxr-xr-x | t/t1050-large.sh | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/t/t1050-large.sh b/t/t1050-large.sh index 4bab6a513c..4f3aa17c99 100755 --- a/t/t1050-large.sh +++ b/t/t1050-large.sh @@ -17,6 +17,14 @@ test_expect_success setup ' export GIT_ALLOC_LIMIT ' +test_expect_success 'enter "large" codepath, with small core.bigFileThreshold' ' + test_when_finished "rm -rf repo" && + + git init --bare repo && + echo large | git -C repo hash-object -w --stdin && + git -C repo -c core.bigfilethreshold=4 fsck +' + # add a large file with different settings while read expect config do @@ -43,42 +51,32 @@ EOF test_expect_success 'add a large file or two' ' git add large1 huge large2 && # make sure we got a single packfile and no loose objects - bad= count=0 idx= && + count=0 idx= && for p in .git/objects/pack/pack-*.pack do - count=$(( $count + 1 )) - if test_path_is_file "$p" && - idx=${p%.pack}.idx && test_path_is_file "$idx" - then - continue - fi - bad=t + count=$(( $count + 1 )) && + test_path_is_file "$p" && + idx=${p%.pack}.idx && + test_path_is_file "$idx" || return 1 done && - test -z "$bad" && test $count = 1 && cnt=$(git show-index <"$idx" | wc -l) && test $cnt = 2 && for l in .git/objects/$OIDPATH_REGEX do - test_path_is_file "$l" || continue - bad=t + test_path_is_missing "$l" || return 1 done && - test -z "$bad" && # attempt to add another copy of the same git add large3 && bad= count=0 && for p in .git/objects/pack/pack-*.pack do - count=$(( $count + 1 )) - if test_path_is_file "$p" && - idx=${p%.pack}.idx && test_path_is_file "$idx" - then - continue - fi - bad=t + count=$(( $count + 1 )) && + test_path_is_file "$p" && + idx=${p%.pack}.idx && + test_path_is_file "$idx" || return 1 done && - test -z "$bad" && test $count = 1 ' @@ -107,7 +105,7 @@ test_expect_success 'packsize limit' ' count=0 && for pi in .git/objects/pack/pack-*.idx do - test_path_is_file "$pi" && count=$(( $count + 1 )) + test_path_is_file "$pi" && count=$(( $count + 1 )) || return 1 done && test $count = 2 && @@ -120,7 +118,7 @@ test_expect_success 'packsize limit' ' for pi in .git/objects/pack/pack-*.idx do - git show-index <"$pi" + git show-index <"$pi" || return 1 done | sed -e "s/^[0-9]* \([0-9a-f]*\) .*/\1/" | sort >actual && |