p2000: add 'git checkout -' test and decrease depth
As we increase our list of commands to test in p2000-sparse-operations.sh, we will want to have a slightly smaller test repository. Reduce the size by a factor of four by reducing the depth of the step that creates a big index around a moderately-sized repository. Also add a step to run 'git checkout -' on repeat. This requires having a previous location in the reflog, so add that to the initialization steps. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
e5ca291076
commit
0d53d19946
|
@ -6,7 +6,7 @@ test_description="test performance of Git operations using the index"
|
||||||
|
|
||||||
test_perf_default_repo
|
test_perf_default_repo
|
||||||
|
|
||||||
SPARSE_CONE=f2/f4/f1
|
SPARSE_CONE=f2/f4
|
||||||
|
|
||||||
test_expect_success 'setup repo and indexes' '
|
test_expect_success 'setup repo and indexes' '
|
||||||
git reset --hard HEAD &&
|
git reset --hard HEAD &&
|
||||||
|
@ -27,7 +27,7 @@ test_expect_success 'setup repo and indexes' '
|
||||||
OLD_COMMIT=$(git rev-parse HEAD) &&
|
OLD_COMMIT=$(git rev-parse HEAD) &&
|
||||||
OLD_TREE=$(git rev-parse HEAD^{tree}) &&
|
OLD_TREE=$(git rev-parse HEAD^{tree}) &&
|
||||||
|
|
||||||
for i in $(test_seq 1 4)
|
for i in $(test_seq 1 3)
|
||||||
do
|
do
|
||||||
cat >in <<-EOF &&
|
cat >in <<-EOF &&
|
||||||
100755 blob $BLOB a
|
100755 blob $BLOB a
|
||||||
|
@ -43,14 +43,23 @@ test_expect_success 'setup repo and indexes' '
|
||||||
done &&
|
done &&
|
||||||
|
|
||||||
git sparse-checkout init --cone &&
|
git sparse-checkout init --cone &&
|
||||||
git branch -f wide $OLD_COMMIT &&
|
git sparse-checkout set $SPARSE_CONE &&
|
||||||
|
git checkout -b wide $OLD_COMMIT &&
|
||||||
|
|
||||||
|
for l2 in f1 f2 f3 f4
|
||||||
|
do
|
||||||
|
echo more bogus >>$SPARSE_CONE/$l2/a &&
|
||||||
|
git commit -a -m "edit $SPARSE_CONE/$l2/a" || return 1
|
||||||
|
done &&
|
||||||
|
|
||||||
git -c core.sparseCheckoutCone=true clone --branch=wide --sparse . full-index-v3 &&
|
git -c core.sparseCheckoutCone=true clone --branch=wide --sparse . full-index-v3 &&
|
||||||
(
|
(
|
||||||
cd full-index-v3 &&
|
cd full-index-v3 &&
|
||||||
git sparse-checkout init --cone &&
|
git sparse-checkout init --cone &&
|
||||||
git sparse-checkout set $SPARSE_CONE &&
|
git sparse-checkout set $SPARSE_CONE &&
|
||||||
git config index.version 3 &&
|
git config index.version 3 &&
|
||||||
git update-index --index-version=3
|
git update-index --index-version=3 &&
|
||||||
|
git checkout HEAD~4
|
||||||
) &&
|
) &&
|
||||||
git -c core.sparseCheckoutCone=true clone --branch=wide --sparse . full-index-v4 &&
|
git -c core.sparseCheckoutCone=true clone --branch=wide --sparse . full-index-v4 &&
|
||||||
(
|
(
|
||||||
|
@ -58,7 +67,8 @@ test_expect_success 'setup repo and indexes' '
|
||||||
git sparse-checkout init --cone &&
|
git sparse-checkout init --cone &&
|
||||||
git sparse-checkout set $SPARSE_CONE &&
|
git sparse-checkout set $SPARSE_CONE &&
|
||||||
git config index.version 4 &&
|
git config index.version 4 &&
|
||||||
git update-index --index-version=4
|
git update-index --index-version=4 &&
|
||||||
|
git checkout HEAD~4
|
||||||
) &&
|
) &&
|
||||||
git -c core.sparseCheckoutCone=true clone --branch=wide --sparse . sparse-index-v3 &&
|
git -c core.sparseCheckoutCone=true clone --branch=wide --sparse . sparse-index-v3 &&
|
||||||
(
|
(
|
||||||
|
@ -66,7 +76,8 @@ test_expect_success 'setup repo and indexes' '
|
||||||
git sparse-checkout init --cone --sparse-index &&
|
git sparse-checkout init --cone --sparse-index &&
|
||||||
git sparse-checkout set $SPARSE_CONE &&
|
git sparse-checkout set $SPARSE_CONE &&
|
||||||
git config index.version 3 &&
|
git config index.version 3 &&
|
||||||
git update-index --index-version=3
|
git update-index --index-version=3 &&
|
||||||
|
git checkout HEAD~4
|
||||||
) &&
|
) &&
|
||||||
git -c core.sparseCheckoutCone=true clone --branch=wide --sparse . sparse-index-v4 &&
|
git -c core.sparseCheckoutCone=true clone --branch=wide --sparse . sparse-index-v4 &&
|
||||||
(
|
(
|
||||||
|
@ -74,7 +85,8 @@ test_expect_success 'setup repo and indexes' '
|
||||||
git sparse-checkout init --cone --sparse-index &&
|
git sparse-checkout init --cone --sparse-index &&
|
||||||
git sparse-checkout set $SPARSE_CONE &&
|
git sparse-checkout set $SPARSE_CONE &&
|
||||||
git config index.version 4 &&
|
git config index.version 4 &&
|
||||||
git update-index --index-version=4
|
git update-index --index-version=4 &&
|
||||||
|
git checkout HEAD~4
|
||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -97,5 +109,6 @@ test_perf_on_all git status
|
||||||
test_perf_on_all git add -A
|
test_perf_on_all git add -A
|
||||||
test_perf_on_all git add .
|
test_perf_on_all git add .
|
||||||
test_perf_on_all git commit -a -m A
|
test_perf_on_all git commit -a -m A
|
||||||
|
test_perf_on_all git checkout -f -
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Loading…
Reference in New Issue