Skip to content

Commit 0df4ed8

Browse files
committed
docker: unify git fetch commands with --prune and --force options
Updated git fetch commands in both Containerfile and entrypoint.sh to include --prune and --force options for better handling of tags and branches. Signed-off-by: Chiho Sin <[email protected]>
1 parent f34a452 commit 0df4ed8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Containerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ ARG WORKSPACE_REPO_REF="main"
2929
RUN git config --global --add safe.directory /workspace \
3030
&& git clone "${WORKSPACE_REPO}" /workspace \
3131
&& git remote add upstream "${WORKSPACE_REPO_UPSTREAM}" \
32-
&& git fetch upstream --tags --prune \
33-
&& git fetch origin --tags --force \
32+
&& git fetch upstream --tags --prune --force \
33+
&& git fetch origin --tags --prune --force \
3434
&& git reset --hard "${WORKSPACE_REPO_REMOTE}/${WORKSPACE_REPO_REF}" \
3535
&& git repack -d
3636

3737
ARG WORKSPACE_BUILD_REMOTE="origin"
3838
ARG WORKSPACE_BUILD_REF="main"
3939
RUN echo "Hard reset repository to: ${WORKSPACE_REPO_REMOTE}/${WORKSPACE_REPO_REF}" \
40-
&& git fetch upstream --tags --prune \
41-
&& git fetch origin --tags --force \
40+
&& git fetch upstream --tags --prune --force \
41+
&& git fetch origin --tags --prune --force \
4242
&& git fetch "${WORKSPACE_BUILD_REMOTE}" "${WORKSPACE_BUILD_REF}" \
4343
&& git reset --hard FETCH_HEAD \
4444
&& git repack -d \

entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ JOBS=$(nproc)
1313
: "${BOARD:=}"
1414

1515
# Reset to the target SHA
16-
git fetch upstream --tags --prune
17-
git fetch origin --tags --force
16+
git fetch upstream --tags --prune --force
17+
git fetch origin --tags --prune --force
1818
git fetch "${REPO_REMOTE}" "${REPO_REF}"
1919
git reset --hard FETCH_HEAD
2020
git repack -d

0 commit comments

Comments
 (0)