aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2019-09-04 14:40:48 -0700
committerJunio C Hamano <gitster@pobox.com>2019-09-05 10:58:28 -0700
commit476998d05bc62b9baaed240da0893ec5d80d676a (patch)
treef51a7d7603c181f14b06a09450fe718a26cca897
parente1fac531ea9f9dc710f6eeae37ea2b38dd5f9fae (diff)
downloadgit-476998d05bc62b9baaed240da0893ec5d80d676a.tar.gz
t3427: accelerate this test by using fast-export and fast-import
fast-export and fast-import can easily handle the simple rewrite that was being done by filter-branch, and should be faster on systems with a slow fork. Measuring the overall time taken for all of t3427 (not just the difference between filter-branch and fast-export/fast-import) shows a speedup of about 5% on Linux and 11% on Mac. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t3427-rebase-subtree.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
index 39e348de16..bec48e6a1f 100755
--- a/t/t3427-rebase-subtree.sh
+++ b/t/t3427-rebase-subtree.sh
@@ -59,7 +59,10 @@ test_expect_success 'setup' '
test_commit files_subtree/master5 &&
git checkout -b to-rebase &&
- git filter-branch --prune-empty -f --subdirectory-filter files_subtree &&
+ git fast-export --no-data HEAD -- files_subtree/ |
+ sed -e "s%\([0-9a-f]\{40\} \)files_subtree/%\1%" |
+ git fast-import --force --quiet &&
+ git reset --hard &&
git commit -m "Empty commit" --allow-empty
'