Skip to content

Fix new tree deletion - #3040

Open
zoriya wants to merge 2 commits into
octokit:mainfrom
zoriya:fix/new-tree-null
Open

Fix new tree deletion#3040
zoriya wants to merge 2 commits into
octokit:mainfrom
zoriya:fix/new-tree-null

Conversation

@zoriya

@zoriya zoriya commented Sep 29, 2025

Copy link
Copy Markdown
Contributor

Fixes #2836


Before the change?

  • When creating a tree with a null content & sha, we got this error from github: Must supply either tree.sha or tree.content. Request will be rejected if both are present
  • Since null are not serialized, gh received neither a sha nor a content value in the tree and that caused the error.

After the change?

  • Actually serialize the null value of the sha to allow deletion of tree items.

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

I made an integration test but running it is a bit of a pain, I noticed there's no CI on my fork and i am opening this PR to get CI runs x)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

@zoriya

zoriya commented Sep 29, 2025

Copy link
Copy Markdown
Contributor Author

Note that i also tested this in one of our project and i can confirm it works.

@github-actions

Copy link
Copy Markdown

👋 Hey Friends, this pull request has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

@github-actions github-actions Bot added the Status: Stale Used by stalebot to clean house label Jun 27, 2026
@zoriya

zoriya commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

We've been using this PR in production for almost a year, would be great to have this merged!

@github-actions github-actions Bot removed the Status: Stale Used by stalebot to clean house label Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🆕 Triage

Development

Successfully merging this pull request may close these issues.

[BUG]: Creating a new tree with a null sha tree object fails

2 participants