79189317

Date: 2024-11-14 15:04:36
Score: 0.5
Natty:
Report link

As phd said in his comment what was missing was this:

unset $(git rev-parse --local-env-vars)

before

test=$(cd ../../; git remote -vv | grep 'my_special_repo')

so that environment variables like GIT_DIR are reset and therefore the hook's script works as expected. This is based on this answer.

PS: Now that it works I reworked my script to its more appropriate form (in my opinion):

test=$(git -C ../../ remote -vv | grep 'my_special_repo')
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: GiatManos