Commit a946602
authored
Fix
Any `/open pr` invocation for `msys2-runtime` after 305e4a8
(msys2-runtime: sync revision and base tag into src/msys2-runtime,
2026-04-24) would die at the same line:
```
src/msys2-runtime/.git/objects/info/alternates: Not a directory
```
I did not need this functionality and therefore did not see that
breakage until [run
27062769399](https://github.com/git-for-windows/git-for-windows-automation/actions/runs/27062769399/job/79878324139#step:9:798)
came around.
The cause is that 305e4a8 added an unconditional block writing to
`src/msys2-runtime/.git/objects/info/alternates`, but
`src/msys2-runtime` is created in the immediately preceding lines via
`git worktree add --no-checkout`, which leaves `.git` as a gitfile
pointer rather than a directory. The commit message of 305e4a8
explicitly described `src/msys2-runtime` as "an independent clone, not a
worktree", which matches a maintainer's local playground but never the
CI environment.
In the worktree case none of the three operations are needed: the object
database and `refs/tags/*` are shared with the bare `msys2-runtime` repo
via the standard worktree refs split, and the worktree's HEAD was
initialized to `$revision` by `git worktree add` because the bare repo's
HEAD had just been pointed there by `git reset --soft`. The
independent-clone case (the maintainer's playground, where `.git` is a
real directory) still benefits from the alternates+update-ref dance, so
this PR guards the entire block on `test -d src/msys2-runtime/.git`
instead of removing it outright.
I considered reverting 305e4a8 wholesale, since the playground path has
never been exercised in CI either, but the conditional is the lower-risk
option that preserves both code paths.
I validated the fix end-to-end against the failing revision by
hard-coding the inputs in a throwaway commit on the topic branch (since
dropped). [Run
27066877451](https://github.com/git-for-windows/git-for-windows-automation/actions/runs/27066877451)
completed in roughly one minute and successfully opened
[git-for-windows/MSYS2-packages#291](git-for-windows/MSYS2-packages#291)
with the expected shape (PKGBUILD bump, `msys2-runtime.commit` bump, one
dropped and two added patches)./open pr for msys2-runtime (#175)1 file changed
Lines changed: 23 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
88 | 103 | | |
89 | 104 | | |
90 | 105 | | |
| |||
0 commit comments