Skip to content

Commit e2522f2

Browse files
rscharfegitster
authored andcommitted
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>
1 parent e4cfe74 commit e2522f2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

t/perf/perf-lib.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ test_perf_create_repo_from () {
8484
objects_dir="$(git -C "$source" rev-parse --git-path objects)"
8585
mkdir -p "$repo/.git"
8686
(
87+
cd "$source" &&
8788
{ cp -Rl "$objects_dir" "$repo/.git/" 2>/dev/null ||
8889
cp -R "$objects_dir" "$repo/.git/"; } &&
8990
for stuff in "$source_git"/*; do
@@ -94,7 +95,9 @@ test_perf_create_repo_from () {
9495
cp -R "$stuff" "$repo/.git/" || exit 1
9596
;;
9697
esac
97-
done &&
98+
done
99+
) &&
100+
(
98101
cd "$repo" &&
99102
git init -q && {
100103
test_have_prereq SYMLINKS ||

0 commit comments

Comments
 (0)