tests/win32/systemdir.c


Log

Author Commit Date CI Message
Edward Thomson f45121ed 2022-02-21T16:13:52 win32: `find_system_dirs` does not return `GIT_ENOTFOUND` Allow for no Git for Windows installation. When there is no GfW found in the path or registry, `git_win32__find_system_dirs` would return a `GIT_ENOTFOUND`. Callers were not expecting this. Since this is no error, we simply return `0` so that callers can move on with their lives.
Edward Thomson 475c6eba 2022-01-17T17:16:02 win32: improve impl & tests for system path / g4w interop We look for a Git for Windows installation to use its git config, so that clients built on libgit2 can interoperate with the Git for Windows CLI (and clients that are built on top of _it_). Look for `git` both in the `PATH` and in the registry. Use the _first_ git install in the path, and the first git install in the registry. Look in both the `etc` dir and the architecture-specific `etc` dirs (`mingw64/etc` and `mingw32/etc`) beneath the installation root. Prefer the git in the `PATH` to the git location in the registry so that users can override that. Include more tests for this behavior.