Skip to content

fix(ci): reuse the head tree when a sync conflict resolves to it - #259

Merged
gjtorikian merged 1 commit into
mainfrom
fix/resolve-sync-conflicts-empty-tree
Nov 4, 2026
Merged

gjtorikian merged 1 commit into
mainfrom
fix/resolve-sync-conflicts-empty-tree

Conversation

@gjtorikian

Copy link
Copy Markdown
Collaborator

When a newer spec PR already contains every change an older sibling merged
to main, resolving the .last-synced-sha conflict yields the PR's own head
tree. uploadTree then POSTed an empty tree list to the Git Trees API,
which GitHub rejects with 422 "Invalid tree info", so resolve-sync-conflicts
crashed (#243 on Oct 28, #258 today) and left the PR conflicting until a
human stepped in.

Skip the upload when the diff against the head is empty and build the
merge commit from the head tree directly.

When a newer spec PR already contains every change an older sibling merged
to main, resolving the .last-synced-sha conflict yields the PR's own head
tree. uploadTree then POSTed an empty `tree` list to the Git Trees API,
which GitHub rejects with 422 "Invalid tree info", so resolve-sync-conflicts
crashed (#243 on Oct 28, #258 today) and left the PR conflicting until a
human stepped in.

Skip the upload when the diff against the head is empty and build the
merge commit from the head tree directly.
@greptile-apps

greptile-apps Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Reuses the PR head tree when resolving .last-synced-sha leaves no file changes.

  • Sync conflict resolution reuses the PR tree when no files changed.

Reviews (1) · Last reviewed commit: "fix(ci): reuse the head tree when a sync..." · Reviewed by Greptile

@gjtorikian
gjtorikian merged commit 664e901 into main Nov 4, 2026
9 checks passed
@gjtorikian
gjtorikian deleted the fix/resolve-sync-conflicts-empty-tree branch November 4, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant