Skip to content

Make Git-based tests independent of user Git configuration #217

Description

@Widthdom

Summary

Tests that create temporary Git repositories inherit the executing user’s global Git configuration. In an environment with commit.gpgsign=true, test commits can request signing credentials or a passphrase and then fail or hang.

Proposed approach

  • Disable commit signing in each test repository with local configuration, or pass the setting explicitly to every test Git command.
  • Isolate Git configuration directories or environment variables per test where appropriate.
  • Never readjust or overwrite the user’s global Git configuration.
  • Centralize test Git invocation and initialization in a shared helper to prevent configuration gaps.
  • Add regression coverage that simulates a global commit.gpgsign=true setting.
  • Review other inherited Git settings that could affect deterministic test behavior.

Acceptance criteria

  • The full test suite runs non-interactively when global commit.gpgsign=true is set.
  • Neither GPG nor SSH signing prompts appear during tests.
  • Tests do not modify the user’s global Git configuration.
  • Local and GitHub Actions runs produce the same result.
  • Git-based tests use a clearly defined common initialization path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .NET codebugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions