Bug: Git invokes hooks from wrong directory.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Community

The following MWE in
https://stackoverflow.com/questions/67273420/why-does-git-execute-hooks-from-an-other-repository/67276138#67276138

shows a bug that Git executes the hooks in `/tmp/A` instead of `/tmp/Githooks`.

# ----------
|# Make simple repo git init "/tmp/A" && cd "/tmp/A" || exit 1
|
|
|
|# Make hook to demonstrate the problem
  mkdir -p ".git/hooks" &&
|
|echo "echo 'EXECUTED!!!'" >.git/hooks/reference-transaction &&
|
|  chmod +x ".git/hooks/reference-transaction" &&
|
|  git clone -c core.hooksPath=".git/hooks" --template= "https://github.com/gabyx/Githooks.git"; /tmp/Githooks|
# ----------

Would be nice to know, if this is indeed a bug and should be fixed?

If somebody points me to the corresponding source code, I could dive in.
Thanks a lot.

BR Gabriel Nützi





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux