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>

René Scharfe committed May 29, 2016 at 18:43 UTC e2522f2acaec35130520f76c36c711b2011ed310
1 file changed +4 -1
t/perf/perf-lib.sh
+4 -1
@@ -84,6 +84,7 @@ test_perf_create_repo_from () {
84 objects_dir="$(git -C "$source" rev-parse --git-path objects)"
85 mkdir -p "$repo/.git"
86 (
87 + cd "$source" &&
88 { cp -Rl "$objects_dir" "$repo/.git/" 2>/dev/null ||
89 cp -R "$objects_dir" "$repo/.git/"; } &&
90 for stuff in "$source_git"/*; do
@@ -94,7 +95,9 @@ test_perf_create_repo_from () {
95 cp -R "$stuff" "$repo/.git/" || exit 1
96 ;;
97 esac
97 - done &&
98 + done
99 + ) &&
100 + (
101 cd "$repo" &&
102 git init -q && {
103 test_have_prereq SYMLINKS ||