Files
Nayan 7f4f72e163 test: stop two fixtures reading the machine they run on
Both CI legs were red, each on a different file, and both for the same
reason: a fixture asserted against ambient git state that happens to be
one way on a developer's machine and another on a runner.

`banner.test.ts` ran every case with `cwd` set to `process.cwd()`, and its
header said why that was safe — the repo is a repo, so the unrelated "not
a git repository" warning never fires. That stopped being true one commit
earlier: the launch warning is unconditional now and `gitStatus` also
checks for a commit identity, which `actions/checkout` does not configure.
So seven `expect(out).toBe("")` cases picked up a git line on ubuntu and
none locally. Each case is about a *flag* warning, so the git half has to
be a constant: the file builds its own repository — work tree, one commit,
a local identity that outranks whatever the machine has — and asserts
against that.

`REPO` is minted at declaration rather than in `beforeAll`, because the
teardown is a recursive force-delete of whatever it names and a binding
assigned in a hook can be something else entirely if that hook throws
first. This is not hypothetical; it deleted `apps/cli` once while this was
being written.

`diff-capture.test.ts` had no `core.autocrlf` pin, and `core.autocrlf=true`
is the Git-for-Windows default. `fileAtHead` reads through `cat-file
--filters`, which applies the conversion a checkout would, so on the
windows leg the LF blob came back CRLF and two `before` assertions differed
by every line terminator. The code is doing exactly what it was changed to
do; the fixture was a repo whose disk is LF while its config says CRLF,
which is not a shape a real checkout takes. Pinned the way
`@airship/git`'s fixture already pins it, with the same reasoning. The
`--filters` conversion keeps its own coverage there, driven by a
`.gitattributes` that reproduces it on every platform.

Also the case that was missing: a work tree with a HEAD and no identity —
exactly what a CI checkout is — now has a test, with the global and system
config scrubbed so a developer's own identity cannot make it pass
vacuously.

Verified by reproducing both failures locally: `core.autocrlf=true` in a
stand-in global config fails the same two diff-capture cases with the same
assertion text as the windows leg, and passes with the pin.
2026-08-16 12:48:27 +05:30
..