#770 pre_push_check: unset GIT_DIR to fix worktree support
Merged by onosek. Opened by vashirov.
vashirov/rpkg i769  into  master

Download 770.patch

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

rebased onto f8c67e415b29635267edbd1c12ef4d107dd186b1

Looks good. Thanks for the change.

Pull-Request has been merged by onosek

Metadata