threads / bug / 56483

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

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

## tl;dr

2 messages between Sep 11, 2021 and Nov 12, 2021.

replies: 1people: 1as markdown or json

Gabriel Nützi· Sep 11, 2021, 06:57 UTC · lore
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· Nov 12, 2021, 17:07 UTC · re: Gabriel Nützi · lore

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

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

← back to recent threads