Граф коммитов

2 Коммитов

Автор SHA1 Сообщение Дата
Michael Haggerty 39102dfaa3 findGitBin(): memoize the result 2023-12-14 01:12:33 +01:00
Michael Haggerty deef63c1cf Use a safer method to locate the `git` executable
`exec.LookPath()` from the Go standard library, which is used by
`exec.Cmd`, implicitly searches for executables in the current
directory before searching `PATH`. This could be awkward if the Git
repository being analyzed contains a file like `git.exe` that could be
run instead of the standard system `git` binary. So introduce a way to
look for the "correct" `git` binary, record it in the `Repository`
instance, and use that binary whenever we need to run `git`.

Don't bother to make the same change in the test code, since tests are
not run inside of a potentially hostile repository.
2021-04-21 09:38:32 +02:00