Skip to content

hook templates have incorrect directory calculation when GIT_DIR is not set #15744

Closed
@Spongman

Description

@Spongman
GIT_DIR=${GIT_DIR:-$(dirname $0)}

for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do

if GIT_DIR is not set then that first line evaluates to the hooks directory containing the script, and thus the 2nd line evaluates to .../hooks/hooks/...

the script should read:

GIT_DIR=${GIT_DIR:-$(dirname $0)/..}

for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions