Skip to content

Commit afdc50d

Browse files
committed
docker: Optimize git fetch commands in Containerfile
Refactor the git fetch commands to improve clarity and maintainability. The order of operations has been adjusted for better organization, ensuring submodules are updated correctly. Signed-off-by: Chiho Sin <[email protected]>
1 parent 290c486 commit afdc50d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Containerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,12 @@ RUN git config --global --add safe.directory /workspace \
2323
&& git config --global protocol.file.allow always \
2424
&& git clone --depth 1 --filter=tree:0 "${BUILD_REPO}" /workspace \
2525
&& cd /workspace && git checkout "${BUILD_REF}" \
26-
&& git submodule update --init --filter=blob:none data extmod lib tools frozen \
27-
&& git fetch --no-recurse-submodules --shallow-since="2021-07-01" --tags "${BUILD_REPO}" HEAD \
28-
&& git fetch --no-recurse-submodules --shallow-since="2021-07-01" origin \
29-
&& git repack -d \
3026
&& git remote add fork "${BUILD_FORK_REPO}" \
3127
&& git fetch fork --filter=tree:0 \
32-
&& git fetch --filter=tree:0 fork "${BUILD_FORK_REF}" \
3328
&& git checkout -b fork-branch "fork/${BUILD_FORK_REF}" \
29+
&& git submodule update --init --filter=blob:none data extmod lib tools frozen \
30+
&& git fetch --no-recurse-submodules --shallow-since="2021-07-01" --tags "${BUILD_REPO}" HEAD \
31+
&& git fetch --no-recurse-submodules --shallow-since="2021-07-01" origin \
3432
&& git repack -d
3533

3634
RUN pip3 install --upgrade -r requirements-doc.txt \

0 commit comments

Comments
 (0)