Skip to content

fix(plugin): use the SHA-256 empty tree for root commit diffs - #1716

Merged
mldangelo-oai merged 1 commit into
openai:mainfrom
WenJing95:fix/sha256-root-commit-diff
Oct 19, 2026
Merged

mldangelo-oai merged 1 commit into
openai:mainfrom
WenJing95:fix/sha256-root-commit-diff

Conversation

@WenJing95

Copy link
Copy Markdown
Contributor

Summary

For a root commit, require_diff_target uses EMPTY_GIT_TREE as the base, which is the SHA-1 empty tree. SHA-256 repos don't have that object, so diff scans of a root commit fail with "unknown revision".

Changes

Added EMPTY_GIT_TREES with both the SHA-1 and SHA-256 IDs, picked via git rev-parse --show-object-format. Added a test with a SHA-256 root commit. Same fix as in closed #449, pulled out on its own.

Testing

Tests pass.

Risk and rollout

SHA-1 repos get the same base as before. Needs Git 2.25+ for --show-object-format.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@github-actions github-actions Bot added the bug Something isn't working label Oct 18, 2026

@mldangelo-oai mldangelo-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Root-commit selection and scan-input generation work for SHA-256 repositories with this change, and SHA-1 behavior is preserved.

@mldangelo-oai
mldangelo-oai merged commit 0ff6855 into openai:main Oct 19, 2026
57 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 19, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants