diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-09-20 15:58:32 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-09-20 16:45:44 +0200 |
commit | 3f922abe49a14316aec87f8a8e2b0fe9ad4d5e52 (patch) | |
tree | b9dbc83026b5a80e6a7b774fb760e9af00ba3d73 /mkosi.images/build | |
parent | Merge pull request #34499 from YHNdnzj/sd-path-trivial-cleanup (diff) | |
download | systemd-3f922abe49a14316aec87f8a8e2b0fe9ad4d5e52.tar.xz systemd-3f922abe49a14316aec87f8a8e2b0fe9ad4d5e52.zip |
mkosi: supress error messages from git
When updating, I get a message like:
fatal: Not a valid object name a67221c3f0d0b81b9b5b3230a71d09044342f1a4^{commit}
The failure here is expected, it just means that an update is
necessary, so suppress output.
Diffstat (limited to 'mkosi.images/build')
-rwxr-xr-x | mkosi.images/build/mkosi.sync | 4 |
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 |