build: fix workspace status detection
`git status --porcelain` doesn't communicate status by return code, not
sure where I got that from.
Tested manually on main branch just now.
Change-Id: I9b05ba552abaf6efe2364b7dec43728eba4ace6e
Reviewed-on: https://review.monogon.dev/c/monogon/+/2766
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
Tested-by: Jenkins CI
diff --git a/build/print-workspace-status.py b/build/print-workspace-status.py
index 70e6e58..af62079 100755
--- a/build/print-workspace-status.py
+++ b/build/print-workspace-status.py
@@ -36,7 +36,8 @@
# Git build tree status: clean or dirty.
git_tree_state: str = "clean"
-if subprocess.call(["git", "status", "--porcelain"], stdout=subprocess.PIPE) == 0:
+git_status = subprocess.check_output(["git", "status", "--porcelain"])
+if git_status.decode().strip() != "":
git_tree_state = "dirty"
# Git commit hash.