1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-28 02:50:16 +03:00

mkosi: Don't fetch remote if the commit to check out already exists

If the commit we're about to check out already exists in the local
repository, don't fetch from the remote repository.
This commit is contained in:
Daan De Meyer 2024-08-29 18:36:55 +02:00 committed by Luca Boccassi
parent 8c7b140164
commit c5730846fe

View File

@ -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
else
elif ! git -C "pkg/$PKG_SUBDIR" cat-file -e "$GIT_COMMIT^{commit}"; then
git -C "pkg/$PKG_SUBDIR" remote set-url origin "$GIT_URL"
git -C "pkg/$PKG_SUBDIR" fetch origin "$GIT_BRANCH"
fi