summaryrefslogtreecommitdiffstats
path: root/mkosi.images
diff options
context:
space:
mode:
Diffstat (limited to 'mkosi.images')
-rwxr-xr-xmkosi.images/build/mkosi.sync4
1 files changed, 2 insertions, 2 deletions
diff --git a/mkosi.images/build/mkosi.sync b/mkosi.images/build/mkosi.sync
index 4cb2b41a4e..02d66e9939 100755
--- a/mkosi.images/build/mkosi.sync
+++ b/mkosi.images/build/mkosi.sync
@@ -8,7 +8,7 @@ if ((${NO_SYNC:-0})) || ((${NO_BUILD:-0})); then
fi
if [[ -d "pkg/$PKG_SUBDIR/.git" ]]; then
- if [[ "$(git -C "pkg/$PKG_SUBDIR" rev-parse HEAD)" == "$GIT_COMMIT" ]]; then
+ if [[ "$(git -C "pkg/$PKG_SUBDIR" rev-parse HEAD 2>/dev/null)" == "$GIT_COMMIT" ]]; then
exit 0
fi
@@ -43,7 +43,7 @@ if [[ ! -e "pkg/$PKG_SUBDIR" ]] || [[ -z "$(ls --almost-all "pkg/$PKG_SUBDIR")"
# --no-cone is needed to check out only one top-level directory
git -C "pkg/$PKG_SUBDIR" sparse-checkout set --no-cone "${GIT_SUBDIR:-}"
fi
-elif ! git -C "pkg/$PKG_SUBDIR" cat-file -e "$GIT_COMMIT^{commit}"; then
+elif ! git -C "pkg/$PKG_SUBDIR" cat-file -e "$GIT_COMMIT^{commit}" 2>/dev/null; then
git -C "pkg/$PKG_SUBDIR" remote set-url origin "$GIT_URL"
git -C "pkg/$PKG_SUBDIR" fetch origin "$GIT_BRANCH"
fi