Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Spongman opened this issue May 6, 2021 · 0 comments · Fixed by #15751
Closed

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

Spongman opened this issue May 6, 2021 · 0 comments · Fixed by #15751
Labels
Milestone

Comments

@Spongman
Copy link

Spongman commented May 6, 2021

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
zeripath added a commit to zeripath/gitea that referenced this issue May 6, 2021
@6543 6543 added the type/bug label May 7, 2021
@6543 6543 added this to the 1.14.2 milestone May 7, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants