summaryrefslogtreecommitdiffstats
path: root/mkosi.images
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-07-03 13:19:34 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2024-07-03 15:42:12 +0200
commit2fe6ad5a64bca187712708d41269091c91500a35 (patch)
treecb2fc928f3a1c1a715762c0ded32b691de13a211 /mkosi.images
parenthwdb: Add some HP IR cameras (diff)
downloadsystemd-2fe6ad5a64bca187712708d41269091c91500a35.tar.xz
systemd-2fe6ad5a64bca187712708d41269091c91500a35.zip
mkosi: Make sure we don't hide errors from git merge-base
Currently if git merge-base fails we'll hide the error and exit with exit status 0. Let's make we only exit early if git merge-base exits with 1 which indicates the current commit is not on the target branch. Any other error is considered fatal.
Diffstat (limited to 'mkosi.images')
-rwxr-xr-xmkosi.images/system/mkosi.sync7
1 files changed, 6 insertions, 1 deletions
diff --git a/mkosi.images/system/mkosi.sync b/mkosi.images/system/mkosi.sync
index d00a776257..517b7c9346 100755
--- a/mkosi.images/system/mkosi.sync
+++ b/mkosi.images/system/mkosi.sync
@@ -16,7 +16,12 @@ if [[ -d "$PKG_SUBDIR/.git" ]]; then
# If work is being done on the packaging rules in a separate branch, don't touch the checkout.
if ! git merge-base --is-ancestor HEAD "origin/$GIT_BRANCH"; then
- exit 0
+ EXIT_STATUS=$?
+ if [[ $EXIT_STATUS -eq 1 ]]; then
+ exit 0
+ else
+ exit $EXIT_STATUS
+ fi
fi
fi