Skip to content

feat!: remove previously deprecated APIs - #1326

Merged
weihanglo merged 3 commits into
rust-lang:mainfrom
weihanglo:remove-deprecated
Oct 31, 2026
Merged

weihanglo merged 3 commits into
rust-lang:mainfrom
weihanglo:remove-deprecated

Conversation

@weihanglo

Copy link
Copy Markdown
Member

git2@0.22 and libgit2-sys@0.19 is a breaking release anyway,
so drop those earlier releases deprecated:

git2

  • Diff::format_email(), replaced by Email::from_diff()
  • Oid::zero(), replaced by Oid::ZERO_SHA1
  • RepoBuilder::hardlinks(), replaced by RepoBuilder::clone_local()
  • RepoBuilder::local(), replaced by RepoBuilder::clone_local()
  • Submodule::url_bytes(), replaced by Submodule::opt_url_bytes()
  • TransportProgress, replaced by IndexerProgress

libgit2-sys

  • git_odb_backend_malloc, replaced by git_odb_backend_data_alloc
  • git_oid_iszero, replaced by git_oid_is_zero
  • git_transfer_progress, replaced by git_indexer_progress

0.22 is a breaking release anyway,
so drop the shims that earlier releases deprecated:

* `Diff::format_email`, along with its unexported options type:
  use `Email::from_diff`.
  Its test now goes through `Email::from_diff`, with the same expected output.
* `RepoBuilder::{local,hardlinks}`: use `RepoBuilder::clone_local`.
  Without `clone_local`, the clone uses `GIT_CLONE_LOCAL_AUTO`,
  which is what the old defaults resolved to.
* `Submodule::url_bytes`: use `Submodule::opt_url_bytes`.
* `Oid::zero`: use `Oid::ZERO_SHA1`.
* `TransportProgress`: use `IndexerProgress`.
0.19 is a breaking release anyway,
so drop the bindings that earlier releases deprecated:

* `git_transfer_progress`: use `git_indexer_progress`.
* `git_oid_iszero`: use `git_oid_is_zero`.
* `git_odb_backend_malloc`: use `git_odb_backend_data_alloc`.

git2 uses none of them.
@rustbot rustbot added the S-waiting-on-review Status: Waiting on review label Oct 31, 2026
@weihanglo
weihanglo added this pull request to the merge queue Oct 31, 2026
Merged via the queue into rust-lang:main with commit 3bcb0e1 Oct 31, 2026
12 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Waiting on review label Oct 31, 2026
@weihanglo
weihanglo deleted the remove-deprecated branch October 31, 2026 14:53
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.

2 participants