dir.c: fix missing dir invalidation in untracked code
[gitweb.git] / t / perf / perf-lib.sh
index b6fc880395791c6f33577dc83387939ceb786bbf..e4c343a6b795b6f990fa278788ad65a0a5cdc4e6 100644 (file)
@@ -56,12 +56,10 @@ MODERN_GIT=$GIT_BUILD_DIR/bin-wrappers/git
 export MODERN_GIT
 
 perf_results_dir=$TEST_OUTPUT_DIRECTORY/test-results
+test -n "$GIT_PERF_SUBSECTION" && perf_results_dir="$perf_results_dir/$GIT_PERF_SUBSECTION"
 mkdir -p "$perf_results_dir"
 rm -f "$perf_results_dir"/$(basename "$0" .sh).subtests
 
-if test -z "$GIT_PERF_REPEAT_COUNT"; then
-       GIT_PERF_REPEAT_COUNT=3
-fi
 die_if_build_dir_not_repo () {
        if ! ( cd "$TEST_DIRECTORY/.." &&
                    git rev-parse --build-dir >/dev/null 2>&1 ); then
@@ -108,7 +106,14 @@ test_perf_create_repo_from () {
                cd "$repo" &&
                "$MODERN_GIT" init -q &&
                test_perf_do_repo_symlink_config_ &&
-               mv .git/hooks .git/hooks-disabled 2>/dev/null
+               mv .git/hooks .git/hooks-disabled 2>/dev/null &&
+               if test -f .git/index.lock
+               then
+                       # We may be copying a repo that can't run "git
+                       # status" due to a locked index. Since we have
+                       # a copy it's fine to remove the lock.
+                       rm .git/index.lock
+               fi
        ) || error "failed to copy repository '$source' to '$repo'"
 }