From cfb88da1b2df3db85c3780738191d52658fe5c02 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 11 Aug 2026 00:05:03 -0700 Subject: [PATCH] test(git): pin show --end-of-options blob reads in the compat matrix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pinned SSH branch diff makes `show --end-of-options :` the only Git command on that path, and depends on it resolving against the named commit rather than live HEAD, and on failing for a path absent at that commit — that failure is what renders additions and deletions. Co-authored-by: Orca --- src/shared/git-binary-compatibility.test.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/shared/git-binary-compatibility.test.ts b/src/shared/git-binary-compatibility.test.ts index 660a2b7aaad..c8fe65d53bb 100644 --- a/src/shared/git-binary-compatibility.test.ts +++ b/src/shared/git-binary-compatibility.test.ts @@ -226,4 +226,25 @@ describeBinaryCompatibility('real Git binary compatibility', () => { expect(lines[0]).toBe('--end-of-options') expect(lines.find((line) => line !== '--end-of-options')).toMatch(/^refs\//) }) + + // Why pin this: `show --end-of-options :` is the only Git command on the + // pinned SSH branch-diff path, and both blob sides depend on it resolving against the + // named commit rather than live HEAD, and on failing (not falling back) for a path + // absent at that commit — that failure is what renders additions and deletions. + it('reads a blob at a pinned object id', async () => { + await writeFile(join(repoPath, 'pinned.txt'), 'pinned\n') + await runGit(['add', 'pinned.txt']) + await runGit(['commit', '-qm', 'pinned']) + const pinnedOid = (await runGit(['rev-parse', 'HEAD'])).stdout.trim() + + await writeFile(join(repoPath, 'pinned.txt'), 'moved on\n') + await runGit(['commit', '-qam', 'after pinned']) + + await expect( + runGit(['show', '--end-of-options', `${pinnedOid}:pinned.txt`]) + ).resolves.toMatchObject({ stdout: 'pinned\n' }) + await expect( + runGit(['show', '--end-of-options', `${pinnedOid}:absent.txt`]) + ).rejects.toBeDefined() + }) })