Merge branch 'tor-github/pr/1683'

This commit is contained in:
David Goulet 2020-01-27 12:04:25 -05:00
commit aba31e2187
2 changed files with 16 additions and 36 deletions

View File

@ -17,13 +17,14 @@ if [ $# -eq 0 ]; then
# When called in pre-commit, check the files modified in this commit # When called in pre-commit, check the files modified in this commit
CHECK_FILTER="git diff --cached --name-only --diff-filter=ACMR" CHECK_FILTER="git diff --cached --name-only --diff-filter=ACMR"
# Use the appropriate owned tor source list to filter the changed files # 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 # This is the layout in 0.3.5 and later.
# Keep these lists consistent:
# - OWNED_TOR_C_FILES in Makefile.am # Keep these lists consistent:
# - CHECK_FILES in pre-commit.git-hook and pre-push.git-hook # - OWNED_TOR_C_FILES in Makefile.am
# - try_parse in check_cocci_parse.sh # - CHECK_FILES in pre-commit.git-hook and pre-push.git-hook
CHECK_FILES="$($CHECK_FILTER \ # - try_parse in check_cocci_parse.sh
CHECK_FILES="$($CHECK_FILTER \
src/lib/*/*.[ch] \ src/lib/*/*.[ch] \
src/core/*/*.[ch] \ src/core/*/*.[ch] \
src/feature/*/*.[ch] \ src/feature/*/*.[ch] \
@ -31,17 +32,7 @@ if [ $# -eq 0 ]; then
src/test/*.[ch] \ src/test/*.[ch] \
src/test/*/*.[ch] \ src/test/*/*.[ch] \
src/tools/*.[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
else else
# When called in pre-push, concatenate the argument array # When called in pre-push, concatenate the argument array
# Fails on special characters in file names # Fails on special characters in file names

View File

@ -63,13 +63,12 @@ do
CHECK_FILTER="git diff --name-only --diff-filter=ACMR $range" CHECK_FILTER="git diff --name-only --diff-filter=ACMR $range"
# Use the appropriate owned tor source list to filter the changed # Use the appropriate owned tor source list to filter the changed
# files # files
if [ -d src/lib ]; then # This is the layout in 0.3.5
# This is the layout in 0.3.5 # Keep these lists consistent:
# Keep these lists consistent: # - OWNED_TOR_C_FILES in Makefile.am
# - OWNED_TOR_C_FILES in Makefile.am # - CHECK_FILES in pre-commit.git-hook and pre-push.git-hook
# - CHECK_FILES in pre-commit.git-hook and pre-push.git-hook # - try_parse in check_cocci_parse.sh
# - try_parse in check_cocci_parse.sh CHECK_FILES="$($CHECK_FILTER \
CHECK_FILES="$($CHECK_FILTER \
src/lib/*/*.[ch] \ src/lib/*/*.[ch] \
src/core/*/*.[ch] \ src/core/*/*.[ch] \
src/feature/*/*.[ch] \ src/feature/*/*.[ch] \
@ -77,17 +76,7 @@ do
src/test/*.[ch] \ src/test/*.[ch] \
src/test/*/*.[ch] \ src/test/*/*.[ch] \
src/tools/*.[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 # We want word splitting here, because file names are space
# separated # separated