dahlbyk / posh-git

A PowerShell environment for Git
http://dahlbyk.github.io/posh-git/
MIT License
7.62k stars 802 forks source link

Fix for failing tests when GPG Signing is enabled globally #949

Open DominikJaniec opened 1 year ago

DominikJaniec commented 1 year ago

Have a global .gitconfig with:

[commit]
    gpgSign = true

Which makes Invoke-Pester to fail tests with:

Those tests will fail, as they could not make commits. Moreover, some tests were being "polluting" global configuration with some test aliases, which were not removed after theirs execution.

Thus, your .gitconfig file became something like:

[commit]
    gpgSign = true
[alias]
    test-944577f4-7f84-4473-931d-93b95d9a65fd = config
    co = checkout

This PR should fix that, and tests should not be broken due to GPG configuration, and no foreign aliases should stay.