Skip to content

testhelper: Fix Git path not being set up

Patrick Steinhardt requested to merge pks-tests-git-path into master

Previous to 6cda774b (Removal of command.GitPath(), 2020-11-26), we used to retrieve the path of the git executable via command.GitPath(). In order to remove one more usage of the global dependency, this was removed in favor of using config.Cfg.Git.BinPath directly everywhere. Doing so is typically not a problem as it always gets configured when loading the configuration file, as it implicitly calls SetGitPath() when verifying the configuration.

One case where this didn't happen though is in our tests. We don't load a configuration, but set it up manually in testhelper.Configure(). But in fact we never configure the git binary path. While I'm confused how this could've possibly worked in the first place, it does cause breakage in some setups.

Fix the issue by calling SetGitPath() in the testhelper.

Edited by Patrick Steinhardt

Merge request reports