mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 18:37:24 +00:00
fix(workspace-cleanup): never take a tag as a workspace's base
This commit is contained in:
@@ -156,6 +156,17 @@ describe('workspace cleanup merge evidence against real Git', () => {
|
||||
expect((await readEvidence(undefined, 'main')).blockers).toEqual(['unpushed-commits'])
|
||||
})
|
||||
|
||||
it('never takes a tag as the base', async () => {
|
||||
await commitFile(worktreePath, 'a.txt')
|
||||
await git(['tag', 'release'], worktreePath)
|
||||
|
||||
expect(await readEvidence('release')).toEqual({
|
||||
blockers: ['unpushed-commits'],
|
||||
merge: { headInDefaultBranch: false, aheadOfDefault: 1 },
|
||||
reasons: []
|
||||
})
|
||||
})
|
||||
|
||||
it('keeps unpushed risk for local commits that never landed', async () => {
|
||||
await commitFile(worktreePath, 'a.txt')
|
||||
|
||||
|
||||
@@ -125,7 +125,9 @@ async function resolveBranchBaseOid(
|
||||
ref,
|
||||
async (candidate) => (await resolveCommitOid(git, candidate)) !== null
|
||||
)
|
||||
if (branchName && worktreeBaseRefFamily(qualified) === branchName) {
|
||||
const family = worktreeBaseRefFamily(qualified)
|
||||
// Only a branch can hold landed work; a tag or a name that resolves to nothing is not a base.
|
||||
if (family === null || family === branchName) {
|
||||
return null
|
||||
}
|
||||
return resolveCommitOid(git, qualified)
|
||||
|
||||
Reference in New Issue
Block a user