From 699f6f454d3f7c2560dd1f79b8d4e72b336c662f Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Wed, 15 May 2024 23:40:18 -0400 Subject: [PATCH 1/2] test: set safe.directory for git repo in apache container See https://github.com/git/git/commit/f4aa8c8bb11dae6e769cd930565173808cbb69c8 --- crates/cargo-test-support/containers/apache/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/cargo-test-support/containers/apache/Dockerfile b/crates/cargo-test-support/containers/apache/Dockerfile index 87260241018..2940ee7c6f6 100644 --- a/crates/cargo-test-support/containers/apache/Dockerfile +++ b/crates/cargo-test-support/containers/apache/Dockerfile @@ -6,6 +6,7 @@ COPY bar /repos/bar WORKDIR /repos/bar RUN git config --global user.email "testuser@example.com" &&\ git config --global user.name "Test User" &&\ + git config --system --add safe.directory '*' &&\ git init -b master . &&\ git add Cargo.toml src &&\ git commit -m "Initial commit" &&\ From 2fd4b440bcfc5a552fc428f912fcae4884b46b00 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Wed, 15 May 2024 23:43:11 -0400 Subject: [PATCH 2/2] test: use `git clone --bare` instead of manual `mv` --- crates/cargo-test-support/containers/apache/Dockerfile | 7 +++---- crates/cargo-test-support/containers/sshd/Dockerfile | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/crates/cargo-test-support/containers/apache/Dockerfile b/crates/cargo-test-support/containers/apache/Dockerfile index 2940ee7c6f6..926f4c35365 100644 --- a/crates/cargo-test-support/containers/apache/Dockerfile +++ b/crates/cargo-test-support/containers/apache/Dockerfile @@ -10,10 +10,9 @@ RUN git config --global user.email "testuser@example.com" &&\ git init -b master . &&\ git add Cargo.toml src &&\ git commit -m "Initial commit" &&\ - mv .git ../bar.git &&\ - cd ../bar.git &&\ - git config --bool core.bare true &&\ - rm -rf ../bar + cd .. &&\ + git clone --bare bar bar.git &&\ + rm -rf bar WORKDIR / EXPOSE 443 diff --git a/crates/cargo-test-support/containers/sshd/Dockerfile b/crates/cargo-test-support/containers/sshd/Dockerfile index 2c055bbc200..e6187750aee 100644 --- a/crates/cargo-test-support/containers/sshd/Dockerfile +++ b/crates/cargo-test-support/containers/sshd/Dockerfile @@ -17,10 +17,9 @@ RUN git config --global user.email "testuser@example.com" &&\ git init -b master . &&\ git add Cargo.toml src &&\ git commit -m "Initial commit" &&\ - mv .git ../bar.git &&\ - cd ../bar.git &&\ - git config --bool core.bare true &&\ - rm -rf ../bar + cd .. &&\ + git clone --bare bar bar.git &&\ + rm -rf bar WORKDIR / USER root