gen/run-ci: Only check files inside of gen
We don't want to consider it a failure if files outside of the gen/
directory differ or are untracked in the build. They aren't supposed to
be covered by this check.
Change-Id: I7dcb85a289fd4270e3201dd92f024b59e64f8b9e
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/gen/run-ci b/gen/run-ci
index 839b182..d38927a 100755
--- a/gen/run-ci
+++ b/gen/run-ci
@@ -1,11 +1,15 @@
#!/bin/bash
-
-"$(git rev-parse --show-toplevel)/gen/regenerate-meson"
-
-GIT_STATUS="$(git status --porcelain --untracked-files)"
-if [ -n "$GIT_STATUS" ]; then
- echo "git status is not clean after running regenerate-meson!"
- echo
- echo "$GIT_STATUS"
- exit 1
+cd "$(dirname "$0")" || exit
+./regenerate-meson || exit
+rc=0
+git --no-pager diff --exit-code -- . || rc=$?
+untracked="$(git ls-files --others --exclude-standard -- .)" || rc=$?
+if [ -n "$untracked" ]; then
+ echo "Untracked files:" >&2
+ echo "$untracked" >&2
+ rc=1
+fi
+if (( rc != 0 )); then
+ echo "Generated meson files differ from expected values" >&2
+ exit 1
fi