Skip to content

feat: expose DiffDelta::similarity#1285

Merged
ehuss merged 1 commit into
rust-lang:mainfrom
WillLillis:expose-diffdelta-similarity
Jun 29, 2026
Merged

feat: expose DiffDelta::similarity#1285
ehuss merged 1 commit into
rust-lang:mainfrom
WillLillis:expose-diffdelta-similarity

Conversation

@WillLillis

Copy link
Copy Markdown
Contributor

The TODO comment here appears to be stale. The similarity score works correctly for me in the delta_similarity test as in a project depending on git2 with this patch applied.

@rustbot rustbot added the S-waiting-on-review Status: Waiting on review label Jun 27, 2026

@DanielEScherzer DanielEScherzer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, other methods already dereference this pointer so we can assume it is valid, similarity is indeed stored as a u16 based on libgit2, https://github.com/libgit2/libgit2/blob/32b564e63f9639eaf5ee90fb7a95b3a650156cbd/include/git2/diff.h#L327

View changes since this review

@ehuss ehuss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ehuss ehuss added this pull request to the merge queue Jun 29, 2026
Merged via the queue into rust-lang:main with commit a00922b Jun 29, 2026
8 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Waiting on review label Jun 29, 2026
@WillLillis WillLillis deleted the expose-diffdelta-similarity branch June 30, 2026 01:13
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.

4 participants