Skip to content

Fix backport bot failing with 'fatal: bad object' on squash merges - #2907

Draft
karthikvetrivel wants to merge 1 commit into
NVIDIA:mainfrom
karthikvetrivel:kv-cherrypick-squash-merge
Draft

karthikvetrivel wants to merge 1 commit into
NVIDIA:mainfrom
karthikvetrivel:kv-cherrypick-squash-merge

Conversation

@karthikvetrivel

@karthikvetrivel karthikvetrivel commented Sep 16, 2026

Copy link
Copy Markdown
Member

The bot cherry-picks the SHAs from pulls.listCommits(), which live on the PR head branch, so after a squash merge those commits are no longer in the runner's clone and git reports fatal: bad object (see #2900).

This change resolves what actually landed on the base branch, keeping the PR's own commits when they are ancestors of it and using merge_commit_sha otherwise.

Copies of this script in k8s-device-plugin, nvidia-container-toolkit and mig-parted need the same fix.

Signed-off-by: Karthik Vetrivel <kvetrivel@nvidia.com>
@karthikvetrivel
karthikvetrivel force-pushed the kv-cherrypick-squash-merge branch from b9b15c4 to 6ec5280 Compare September 17, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant