Skip to content

Commit c39ac82

Browse files
author
holtwilkins
committed
Update pre-commit
Instead, you could just ignore symlinks that start with .. and leave it to the user to ensure that pre-commit and hooks/ are co-located, wherever they *actually* are on the filesystem.
1 parent 35f18b1 commit c39ac82

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pre-commit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ RC=0
77
subhook_root=$git_root/.git/hooks/commit_hooks
88

99
hook_dir="$(dirname $0)"
10-
hook_symlink="$(readlink -f $0)"
10+
hook_symlink="$(readlink $0)"
1111

1212
# Figure out where commit hooks are if pre-commit is setup as a symlink
13-
if [ ! -z "$hook_symlink" ]; then
13+
if [ ! -z "$hook_symlink" ] && ! [[ "$hook_symlink" == ../* ]]; then
1414
subhook_root="$(dirname $hook_symlink)/commit_hooks"
1515
fi
1616

0 commit comments

Comments
 (0)