CONTRIBUTING.md says to use make install-hooks to install pre- and post-commit hooks, but if you do that then the self-tests fail on commit:
````
% # make a meaningless, whitespace change to a file in src/commands/
% git commit -a
1..88
ok 1 run 'add' normally
ok 2 run 'add' for unignored file
...
ok 27 run 'hide' with '-P'
not ok 28 run 'hide' from inside subdirectory
not ok 29 run 'hide' with missing file
ok 30 run 'hide' with multiple files
...
```
@joshrabinowitz that's why I had this solution: https://github.com/sobolevn/git-secret/blob/d5c138ab609066e90b0ef916cac819a96cfadbf3/tests/test_add.bats#L71-L76
@sobolevn but.... why does running under a 'git commit' fail?
Is there a better fix for this that doesn't require disabling the test in that situation?
That's some deep git magic about its internal state: it is obviously different in normat mode and "commiting" state. I am not sure how different it is, however. And I was not able to find the correct solution back then.
For clarity, the issue is related to git rev-parse not working as expected when run from this pre-commit githook:
calls to rev-parse are here:
https://github.com/sobolevn/git-secret/blob/26ecd390d6189f156c08b8ec3e134c0e3d133ffd/src/_utils/_git_secret_tools.sh#L331
and
https://github.com/sobolevn/git-secret/blob/26ecd390d6189f156c08b8ec3e134c0e3d133ffd/src/_utils/_git_secret_tools.sh#L354