You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating system (Linux, macOS, Windows): WSL2 within Windows
Operating system version: Windows 11
Python version:
Describe the bug
I am using a Git worktree. When I commit to the initial worktree directory, the pre-commit check passes. When committing to another Git worktree directory, the path doesn't resolve and there's a message saying it's not a git repository.
Steps to reproduce:
clone a Git repository locally
add another branch from the same repository as a Git worktree: git worktree add ../other-branch-dir feature/my_other_branch
Run ggshield secret scan pre-commit
An error occurs
Actual result:
git commit -m "TESTING COMMIT IN WORKTREE"
latest: Pulling from someplace/ggshield
Digest: sha256:2eb6blahblah
Status: Image is up to date for quay.io/someplace/ggshield:latest
quay.io/someplace/ggshield:latest
fatal: not a git repository: /code/../original-server-code-dir/worktrees/other-branch-dir
make: *** [.make/tools-ggshield.mk:11: ggshield/pre-commit] Error 128
The ggshield check passes without error. This is the output when committing from the original folder:
latest: Pulling from someplace/ggshield
Digest: sha256:2eb6blahblah
Status: Image is up to date for quay.io/someplace/ggshield:latest
quay.io/someplace/ggshield:latest
No secrets have been found
[feature/my_original_branch 44blahblah] TEST COMMIT
If applicable, add logs or screenshots to help explain your problem.
The text was updated successfully, but these errors were encountered:
Environment
Describe the bug
I am using a Git worktree. When I commit to the initial worktree directory, the pre-commit check passes. When committing to another Git worktree directory, the path doesn't resolve and there's a message saying it's not a git repository.
Steps to reproduce:
git worktree add ../other-branch-dir feature/my_other_branch
ggshield secret scan pre-commit
Actual result:
The make target runs the following using Docker:
Expected result:
The ggshield check passes without error. This is the output when committing from the original folder:
If applicable, add logs or screenshots to help explain your problem.
The text was updated successfully, but these errors were encountered: