mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-06-14 20:24:05 +02:00
build: Ensure the installed pre-push git hook matches its source.
* Makefile.am ($(GIT_HOOKS_DIR)/pre-push): Make a phony target, and copy file when the target differs from its prerequisite. Fixes: #7645 Reported-by: Gábor Udvari <mail@gaborudvari.com> Change-Id: I6b5f677afe59c25a4d8905da814af4bbd91fb401
This commit is contained in:
@@ -1281,6 +1281,14 @@ $(GIT_HOOKS_DIR):
|
||||
$(GIT_HOOKS_DIR)/%: etc/git/% | $(GIT_HOOKS_DIR)/
|
||||
if [ -n "$(GIT_HOOKS_DIR)" ]; then cp "$<" "$@"; fi
|
||||
|
||||
# Special-case the pre-push hook installation, to ensure it is always
|
||||
# up-to-date with its source.
|
||||
.PHONY: $(GIT_HOOKS_DIR)/pre-push
|
||||
$(GIT_HOOKS_DIR)/pre-push: etc/git/pre-push | $(GIT_HOOKS_DIR)
|
||||
@if [ -n "$(GIT_HOOKS_DIR)" ]; then \
|
||||
cmp "--silent" "$<" "$@" || cp "$<" "$@"; \
|
||||
fi
|
||||
|
||||
$(GIT_CONFIG_FILE): etc/git/gitconfig
|
||||
if [ -n "$(GIT_CONFIG_FILE)" ]; then \
|
||||
git config --fixed-value --replace-all include.path \
|
||||
|
||||
Reference in New Issue
Block a user