gittuf/pkg
Andrew Nesbitt ac08370b1e
pkg/gitinterface: isolate TestCanSign from host git config
TestCanSign/explicit_ssh,_no_key sets gpg.format=ssh in a temp repo and
expects CanSign() to fail because no user.signingkey is set. On a host
with user.signingkey in ~/.gitconfig, the temp repo inherits the key via
scoped config and the test passes CanSign() unexpectedly.

The existing comment at the top of TestCanSign acknowledges this and
skips the assertion as a result. Point GIT_CONFIG_GLOBAL and
GIT_CONFIG_SYSTEM at /dev/null for the duration of the test instead, so
all subtests can run regardless of the host's signing config.

Signed-off-by: Andrew Nesbitt <andrewnez@gmail.com>
2026-06-29 17:14:01 +01:00
..
gitinterface pkg/gitinterface: isolate TestCanSign from host git config 2026-06-29 17:14:01 +01:00