test: use git clone --bare instead of manual mv

This commit is contained in:
Weihang Lo 2024-05-15 23:43:11 -04:00
parent 699f6f454d
commit 2fd4b440bc
No known key found for this signature in database
GPG Key ID: D7DBF189825E82E7
2 changed files with 6 additions and 8 deletions

View File

@ -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

View File

@ -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