File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,11 +33,11 @@ skip_lint="${SKIP_LINT_COMMIT}"
3333# Get the path to a file containing the commit message:
3434commit_message=" $1 "
3535
36- # Determine root directory:
37- root =$( git rev-parse --show-toplevel )
36+ # Resolve the location of the Git directory:
37+ git_dir =$( git rev-parse --absolute-git-dir )
3838
3939# Define the path to a report generated during the pre-commit hook:
40- pre_commit_report=" ${root} /.git /hooks-cache/pre_commit_report.yml"
40+ pre_commit_report=" ${git_dir} /hooks-cache/pre_commit_report.yml"
4141
4242
4343# FUNCTIONS #
Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ skip_editorconfig="${SKIP_LINT_EDITORCONFIG}"
5050# Determine root directory:
5151root=$( git rev-parse --show-toplevel)
5252
53+ # Resolve the location of the Git directory:
54+ git_dir=$( git rev-parse --absolute-git-dir)
55+
5356# Define the path to a utility for linting filenames:
5457lint_filenames=" ${root} /lib/node_modules/@stdlib/_tools/lint/filenames/bin/cli"
5558
@@ -81,7 +84,7 @@ cppcheck_tests_fixtures_suppressions_list="${root}/etc/cppcheck/suppressions.tes
8184cppcheck_benchmarks_suppressions_list=" ${root} /etc/cppcheck/suppressions.benchmarks.txt"
8285
8386# Define the path to a directory for caching hook results:
84- cache_dir=" ${root} /.git /hooks-cache"
87+ cache_dir=" ${git_dir} /hooks-cache"
8588
8689# Define the path to a file for storing hook results:
8790cache_file=" ${cache_dir} /pre_commit_report.yml"
Original file line number Diff line number Diff line change @@ -59,8 +59,11 @@ GIT_CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
5959# Determine root directory:
6060root=$( git rev-parse --show-toplevel)
6161
62+ # Resolve the location of the Git directory:
63+ git_dir=$( git rev-parse --absolute-git-dir)
64+
6265# Define the path to a directory for caching hook results:
63- cache_dir=" ${root} /.git /hooks-cache"
66+ cache_dir=" ${git_dir} /hooks-cache"
6467
6568# Define the path to a file for storing hook results:
6669cache_file=" ${cache_dir} /pre_push_report.yml"
You can’t perform that action at this time.
0 commit comments