Skip to content

Windows: host git guard refuses repos under 8.3 short-name paths #1381

Open

Description

@mattpocock

What happens

On Windows, a branch-strategy or merge-to-head run whose repo sits under an 8.3 short-name path (for example C:\Users\RUNNER~1\AppData\Local\Temp\...) can fail with:

HostGitError: Refusing to run git on the host…

The host git guard compares paths, and the short-name form (RUNNER~1) doesn't match the long-name form git or Node resolves (runneradmin), so the guard refuses a repo it should accept.

Evidence

Seen on 2026-11-01 in the windows CI job of #1380 (test migration of the structured output tests). The new e2e tests created their repo under os.tmpdir(), which on the GitHub Windows runner is a short-name path. Resolving the temp dir with fs.realpathSync.native first made the runs pass. That change is in the test only; the product code is unchanged.

Expected

A run started from a short-name path behaves the same as one started from the long-name path. Normalising both sides with realpathSync.native before comparing is the likely fix (not yet confirmed).

Repro (sketch)

On Windows, create a repo under %TEMP% without resolving the short name, then run({ branchStrategy: { type: "branch", branch: "x" }, ... }) with noSandbox().

This issue was AI-generated (Claude Code) on behalf of @mattpocock.

Activity

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions