Skip to content

core.hooksPath not resolved from repository root #1438

Open
@ethanwu10

Description

@ethanwu10

Description of the bug

If core.hooksPath is a relative path, git branchless init always resolves it relative to the directory in which it was invoked, not relative to the root of the repo like how Git interprets it.

Reproduction:

git init
git config core.hooksPath hooks
mkdir foo
cd foo
git branchless init
ls

Expected behavior

Hooks should have been installed to /hooks in the repo

Actual behavior

Hooks are installed to /foo/hooks (and then ignored by git)

Version of rustc

No response

Automated bug report

No response

Version of git-branchless

git-branchless-opts 0.10.0

Version of git

git version 2.39.5 (Apple Git-154)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions