summaryrefslogtreecommitdiff
path: root/t/perf
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-08-03 11:01:13 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-08-03 11:01:13 -0700
commit54d673f25d571ac2d8f50b1ccea4a7d69ca8a056 (patch)
tree2357d79569f29fa36a998dcf723756e015a12f8d /t/perf
parentMerge branch 'cb/parse-magnitude' (diff)
parentread_gitfile_gently: fix use-after-free (diff)
downloadtgif-54d673f25d571ac2d8f50b1ccea4a7d69ca8a056.tar.xz
Merge branch 'ee/clean-remove-dirs'
Replace "is this subdirectory a separate repository that should not be touched?" check "git clean" does by checking if it has .git/HEAD using the submodule-related code with a more optimized check. * ee/clean-remove-dirs: read_gitfile_gently: fix use-after-free clean: improve performance when removing lots of directories p7300: add performance tests for clean t7300: add tests to document behavior of clean and nested git setup: sanity check file size in read_gitfile_gently setup: add gentle version of read_gitfile
Diffstat (limited to 't/perf')
-rwxr-xr-xt/perf/p7300-clean.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/perf/p7300-clean.sh b/t/perf/p7300-clean.sh
new file mode 100755
index 0000000000..ec94cdd657
--- /dev/null
+++ b/t/perf/p7300-clean.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+test_description="Test git-clean performance"
+
+. ./perf-lib.sh
+
+test_perf_default_repo
+test_checkout_worktree
+
+test_expect_success 'setup untracked directory with many sub dirs' '
+ rm -rf 500_sub_dirs 100000_sub_dirs clean_test_dir &&
+ mkdir 500_sub_dirs 100000_sub_dirs clean_test_dir &&
+ for i in $(test_seq 1 500)
+ do
+ mkdir 500_sub_dirs/dir$i || return $?
+ done &&
+ for i in $(test_seq 1 200)
+ do
+ cp -r 500_sub_dirs 100000_sub_dirs/dir$i || return $?
+ done
+'
+
+test_perf 'clean many untracked sub dirs, check for nested git' '
+ git clean -n -q -f -d 100000_sub_dirs/
+'
+
+test_perf 'clean many untracked sub dirs, ignore nested git' '
+ git clean -n -q -f -f -d 100000_sub_dirs/
+'
+
+test_done