Skip to content

ggshield install --mode local installs in the wrong directory #989

Open
@cfrenkel-mdsol

Description

@cfrenkel-mdsol

Environment

  • ggshield version: 1.32.2
  • Operating system (Linux, macOS, Windows): Windows
  • Operating system version: Windows 10
  • Python version: 3.12.5

Describe the bug

ggshield install -mode=local does not honor core.hookspath
And even with core.hookspath unset it will install the hooks in the current directory rather than in the repo root.

Steps to reproduce:

  1. cd to a sub-directory
  2. Run command ggshield install --mode=local -t pre-commit

core.hookspath not being honored

  1. git config set core.hookspath=githooks
  2. (optionally) cd to a sub-directory
  3. Run command ggshield install --mode=local -t pre-commit

Actual result:

ls .git/hooks
will show the hook

Expected result:

'ls $(git rev-parse --show-toplevel)/.git/hooks`
should show the hook

or if core.hookspath is set

ls $(git rev-parse --show-toplevel)/githooks
should show the hook

If applicable, add logs or screenshots to help explain your problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:newThis issue needs to be reviewedtype:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions