Skip to content

Read a HOME or XDG_CONFIG_HOME Override on a Git Command as an Unread Config File in the Write Guard #3057

Closed

Description

@ptr727

Context

Found while closing #2972 and the config environment item of #2943 on feature/guard-hidden-commands-3010. That change treats a GIT_CONFIG_GLOBAL or GIT_CONFIG_SYSTEM file as one the guard does not read, as an include override is.

Gap

HOME and XDG_CONFIG_HOME also decide which global config file git reads, so an assignment to either on a git command points git at a file that may set a command-running key, an alias, or core.hooksPath. Constructed probes against the branch guard, both allowed:

  • HOME=/example/home git status
  • XDG_CONFIG_HOME=/example/cfg git fetch origin

Possible Direction

Treat either assignment on a git command as an unread config file, as GIT_CONFIG_GLOBAL is now. Measure the over-denial first, since a HOME override is a common test-isolation shape.

Activity

  1. added
    pre-existing
    script
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pre-existingscript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions