Skip to content

Commit b7ae258

Browse files
committed
Refactor test-git-no-uncommitted-changes to independent script
1 parent 82a439a commit b7ae258

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

.github/workflows/ci-meson.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
id: check_update_meson
8080
run: |
8181
python3 tools/update-meson.py
82-
make test-git-no-uncommitted-changes
82+
./tools/test-git-no-uncommitted-changes
8383
continue-on-error: true
8484

8585
- name: Show files changed by update-meson

Makefile

+1-7
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,7 @@ TEST_TARGET = $@
254254
TEST = ./sage -t --logfile=$(TEST_LOG) $(TEST_FLAGS) --optional=$(TEST_OPTIONAL) $(TEST_FILES)
255255

256256
test-git-no-uncommitted-changes:
257-
@UNCOMMITTED=$$(git status --porcelain); \
258-
if [ -n "$$UNCOMMITTED" ]; then \
259-
echo "Error: the git repo has uncommitted changes:"; \
260-
echo "$$UNCOMMITTED"; \
261-
echo; \
262-
exit 1; \
263-
fi
257+
./tools/test-git-no-uncommitted-changes
264258

265259
test: all
266260
@echo '### make $(TEST_TARGET): Running $(TEST)' >> $(TEST_LOG)

tools/test-git-no-uncommitted-changes

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env sh
2+
# Test that there is no uncommitted changes in the repository. Return failure if there is.
3+
# Can also be invoked with `make test-git-no-uncommitted-changes` from top level.
4+
UNCOMMITTED="$(git status --porcelain)";
5+
if [ -n "$UNCOMMITTED" ]; then
6+
echo "Error: the git repo has uncommitted changes:";
7+
echo "$UNCOMMITTED";
8+
echo;
9+
exit 1;
10+
fi

0 commit comments

Comments
 (0)