Skip to content

Commit 3159ed4

Browse files
committed
Makefile: don't run git checkout on behalf of the user
I know this is safe because we check the repo is clean, but don't like code I run on a repo to change the git state of an other repo nearby. Maybe that's just me, though
1 parent 61635a4 commit 3159ed4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ endif
5858

5959
.PHONY: all
6060
all: ensure_prerequisites
61-
git -C $(CPYTHON_PATH) checkout $(CPYTHON_CURRENT_COMMIT)
61+
@if [ $(shell git -C $(CPYTHON_PATH) rev-parse HEAD) != $(CPYTHON_CURRENT_COMMIT) ]; then \
62+
echo "Your $(CPYTHON_PATH) repositoy is not at the currect revision"; \
63+
echo "You can run try and run "; \
64+
echo "git -C $(CPYTHON_PATH) checkout $(CPYTHON_CURRENT_COMMIT)"; \
65+
echo "to fix the problem"; \
66+
exit 1; \
67+
fi
6268
mkdir -p locales/$(LANGUAGE)/LC_MESSAGES/
6369
$(CP_CMD) -u --parents *.po */*.po locales/$(LANGUAGE)/LC_MESSAGES/
6470
$(MAKE) -C $(CPYTHON_PATH)/Doc/ \

0 commit comments

Comments
 (0)