# Fwd: Bug report: Githook reference-transaction does not change working directory on git clone

2 messages from 2021-09-11 to 2021-11-12. Participants: Gabriel Nützi.
Thread: https://gitlist.dev/t/56483

## Gabriel Nützi, 2021-09-11 06:57

Subject: Fwd: Bug report: Githook reference-transaction does not change working directory on git clone
Message-ID: <CAA9rTuf+AwPJYki6O_hEPAS=aZta3HuvQOWLHnRfv5FV0DfYSA@mail.gmail.com>
URL: https://gitlist.dev/e/CAA9rTuf%2BAwPJYki6O_hEPAS%3DaZta3HuvQOWLHnRfv5FV0DfYSA%40mail.gmail.com
In-Reply-To: <CAA9rTucw0wzghy_onKgSWt=QmVoB1qsV108V7NYApJyV8FCpNw@mail.gmail.com>

```
Dear all,

With git 2.33.0, the "reference-transaction" hook does not change the
working directory to the worktree (or GIT_DIR) when launched on `git
clone`. It is just unchanged in this exact scenario.

MWE:

cd temp
git init A
mkdir -p templates/hooks && echo "CWD: pwd" >
templates/hooks/reference-transaction
git config --global init.templateDir templates
git clone A test

Wrong Output:
CWD: temp
CWD: temp
CWD: temp
CWD: temp

I have seen this problems already on other occasion with other hooks.
Probably the problem exists also there.

Thanks for fixing this if this is really a bug (??).

BR

```

## Gabriel Nützi, 2021-11-12 17:07

Subject: Bug report: Githook reference-transaction does not change working directory on git clone
Message-ID: <CAA9rTud6MrFjhAtCiK7V5jgQ=bUNexqUKTtcDUT1L4=7x+OQgQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAA9rTud6MrFjhAtCiK7V5jgQ%3DbUNexqUKTtcDUT1L4%3D7x%2BOQgQ%40mail.gmail.com
In-Reply-To: <CAA9rTuf+AwPJYki6O_hEPAS=aZta3HuvQOWLHnRfv5FV0DfYSA@mail.gmail.com>

```
Dear all,

With git 2.33.0, the "reference-transaction" hook does not change the
working directory to the worktree (or GIT_DIR) when launched on `git
clone`. It is just unchanged in this exact scenario.

MWE:

cd temp
git init A
mkdir -p templates/hooks && echo "CWD: pwd" >
templates/hooks/reference-transaction
git config --global init.templateDir templates
git clone A test

Wrong Output:
CWD: temp
CWD: temp
CWD: temp
CWD: temp

I have seen this problems already on other occasion with other hooks.
Probably the problem exists also there.

Thanks for fixing this if this is really a bug (??).
Any reply to this would help.

BR

```
