When running inside a git hook from a worktree, git sets GIT_DIR
to the worktree's git directory. If inherited by subprocess calls,
it causes git commands to operate on the worktree instead of the
temporary clone, detaching its HEAD.
Remove GIT_DIR from the environment before running git commands in
the temporary clone and restore it afterward.
When running inside a git hook from a worktree, git sets GIT_DIR
to the worktree's git directory. If inherited by subprocess calls,
it causes git commands to operate on the worktree instead of the
temporary clone, detaching its HEAD.
Remove GIT_DIR from the environment before running git commands in
the temporary clone and restore it afterward.
Fixes: #769
Signed-off-by: Viktor Ashirov vashirov@redhat.com