mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 15:43:32 +01:00
scripts/git: Restore a dropped check for pre-commit in pre-push
Bugfix on 31919; not in any released version of Tor.
This commit is contained in:
parent
7e73c0d5a1
commit
e046903f93
@ -58,35 +58,39 @@ do
|
||||
fi
|
||||
|
||||
# Call the pre-commit hook for the common checks, if it is executable
|
||||
# Only check the files newly modified in this branch
|
||||
CHECK_FILTER="git diff --name-only --diff-filter=ACMR $range"
|
||||
# Use the appropriate owned tor source list to filter the changed files
|
||||
if [ -d src/lib ]; then
|
||||
# This is the layout in 0.3.5
|
||||
CHECK_FILES="$($CHECK_FILTER \
|
||||
src/lib/*/*.[ch] \
|
||||
src/core/*/*.[ch] \
|
||||
src/feature/*/*.[ch] \
|
||||
src/app/*/*.[ch] \
|
||||
src/test/*.[ch] \
|
||||
src/test/*/*.[ch] \
|
||||
src/tools/*.[ch] \
|
||||
)"
|
||||
elif [ -d src/common ]; then
|
||||
# This was the layout before 0.3.5
|
||||
CHECK_FILES="$($CHECK_FILTER \
|
||||
src/common/*/*.[ch] \
|
||||
src/or/*/*.[ch] \
|
||||
src/test/*.[ch] \
|
||||
src/test/*/*.[ch] \
|
||||
src/tools/*.[ch]
|
||||
)"
|
||||
fi
|
||||
if [ -x scripts/git/pre-commit.git-hook ]; then
|
||||
# Only check the files newly modified in this branch
|
||||
CHECK_FILTER="git diff --name-only --diff-filter=ACMR $range"
|
||||
# Use the appropriate owned tor source list to filter the changed
|
||||
# files
|
||||
if [ -d src/lib ]; then
|
||||
# This is the layout in 0.3.5
|
||||
CHECK_FILES="$($CHECK_FILTER \
|
||||
src/lib/*/*.[ch] \
|
||||
src/core/*/*.[ch] \
|
||||
src/feature/*/*.[ch] \
|
||||
src/app/*/*.[ch] \
|
||||
src/test/*.[ch] \
|
||||
src/test/*/*.[ch] \
|
||||
src/tools/*.[ch] \
|
||||
)"
|
||||
elif [ -d src/common ]; then
|
||||
# This was the layout before 0.3.5
|
||||
CHECK_FILES="$($CHECK_FILTER \
|
||||
src/common/*/*.[ch] \
|
||||
src/or/*/*.[ch] \
|
||||
src/test/*.[ch] \
|
||||
src/test/*/*.[ch] \
|
||||
src/tools/*.[ch]
|
||||
)"
|
||||
fi
|
||||
|
||||
# We want word splitting here, because file names are space separated
|
||||
# shellcheck disable=SC2086
|
||||
if ! scripts/git/pre-commit.git-hook $CHECK_FILES ; then
|
||||
exit 1
|
||||
# We want word splitting here, because file names are space
|
||||
# separated
|
||||
# shellcheck disable=SC2086
|
||||
if ! scripts/git/pre-commit.git-hook $CHECK_FILES ; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$remote_name" != "$upstream_name" ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user