Skip to content

Commit

Permalink
fix: prevent git stash errors when no changes are present
Browse files Browse the repository at this point in the history
- Added a check before running 'git stash' to avoid errors when no changes exist.
* Ensures smooth build process without unnecessary failures.
* Improves the stability of Docker builds by handling edge cases correctly.


Signed-off-by: CodeOpusa <[email protected]>
  • Loading branch information
mavci42 authored Jan 25, 2025
1 parent 41ee793 commit 4b348b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile.upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ADD . /src
WORKDIR /src

# Save the uncommited changes
RUN git stash -u -m "$GIT_STASH_MESSAGE"
RUN git diff-index --quiet HEAD || git stash -u -m "$GIT_STASH_MESSAGE"
# Switch to the baseline version
RUN git checkout $BASELINE_VERSION_TAG

Expand Down

0 comments on commit 4b348b7

Please sign in to comment.