summaryrefslogtreecommitdiff
path: root/t/perf/perf-lib.sh
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-05-29 16:43:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-05-31 20:44:59 (GMT)
commite2522f2acaec35130520f76c36c711b2011ed310 (patch)
tree4aa13e7653a3319e8573e0eb467768499a7d8ff8 /t/perf/perf-lib.sh
parente4cfe74cd083c15947f57760d05d0e286a585afc (diff)
downloadgit-e2522f2acaec35130520f76c36c711b2011ed310.zip
git-e2522f2acaec35130520f76c36c711b2011ed310.tar.gz
git-e2522f2acaec35130520f76c36c711b2011ed310.tar.bz2
perf: make the tests work without a worktree
In regular repositories $source_git and $objects_dir contain relative paths based on $source. Go there to allow cp to resolve them. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/perf/perf-lib.sh')
-rw-r--r--t/perf/perf-lib.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index 5ef1744..18c363e 100644
--- a/t/perf/perf-lib.sh
+++ b/t/perf/perf-lib.sh
@@ -84,6 +84,7 @@ test_perf_create_repo_from () {
objects_dir="$(git -C "$source" rev-parse --git-path objects)"
mkdir -p "$repo/.git"
(
+ cd "$source" &&
{ cp -Rl "$objects_dir" "$repo/.git/" 2>/dev/null ||
cp -R "$objects_dir" "$repo/.git/"; } &&
for stuff in "$source_git"/*; do
@@ -94,7 +95,9 @@ test_perf_create_repo_from () {
cp -R "$stuff" "$repo/.git/" || exit 1
;;
esac
- done &&
+ done
+ ) &&
+ (
cd "$repo" &&
git init -q && {
test_have_prereq SYMLINKS ||