Skip to content

git subrepo pull/push fails if post-checkout script in a separate hooks folder writes to .git #499

@afcuttin

Description

@afcuttin

If I change core.hooksPath to a folder (.githooks) different that .git/hooks/, and the post-checkout hook writes a file in .git, git subrepo pull fails as follows:

$ git subrepo pull aux
git-subrepo: Command failed: 'git worktree add .git/tmp/subrepo/aux subrepo/aux'.
Preparing .git/tmp/subrepo/aux (identifier aux)
HEAD is now at fcf0b6a verification of mechanical requirements
/path/to/project/.githooks/post-checkout: 15: /path/to/project/.githooks/post-checkout: cannot create .git/gitHeadInfo.gin: Directory nonexistent

This happens also with the default core.hooksPath setting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions