|
56 | 56 | //!
|
57 | 57 | //! ### `libgit2` API to `gix`
|
58 | 58 | //!
|
59 |
| -//! This section is a 'striving to be complete' mapping from `libgit2` APIs to the respective methods in `gix`. |
| 59 | +//! This doc-aliases are used to help finding methods under a possibly changed name. Just search in the docs. |
| 60 | +//! Entering `git2` into the search field will also surface all methods with such annotations. |
60 | 61 | //!
|
61 |
| -//! * [`git2::Repository::open()`](https://docs.rs/git2/*/git2/struct.Repository.html#method.open) ➡ [`open()`] |
62 |
| -//! * [`git2::Repository::open_bare()`](https://docs.rs/git2/*/git2/struct.Repository.html#method.open_bare) ➡ ❌ |
63 |
| -//! * [`git2::Repository::open_from_env()`](https://docs.rs/git2/*/git2/struct.Repository.html#method.open_from_env) ➡ [`ThreadSafeRepository::open_with_environment_overrides()`] |
64 |
| -//! * [`git2::Repository::open_ext()`](https://docs.rs/git2/*/git2/struct.Repository.html#method.open_ext) ➡ [`open_opts()`] |
65 |
| -//! * [`git2::Repository::revparse()`](https://docs.rs/git2/*/git2/struct.Repository.html#method.revparse) ➡ [`Repository::rev_parse()`] |
66 |
| -//! * [`git2::Repository::revparse_single()`](https://docs.rs/git2/*/git2/struct.Repository.html#method.revparse_single) ➡ [`Repository::rev_parse_single()`] |
67 |
| -//! * [`git2::Repository::revwalk()`](https://docs.rs/git2/*/git2/struct.Repository.html#method.revwalk) ➡ [`Repository::rev_walk()`] |
| 62 | +//! What follows is a list of methods you might be missing, along with workarounds if available. |
| 63 | +//! * [`git2::Repository::open_bare()`](https://docs.rs/git2/*/git2/struct.Repository.html#method.open_bare) ➡ ❌ - use [`open()`] and discard it is not bare. |
68 | 64 | //! * [`git2::build::CheckoutBuilder::disable_filters()](https://docs.rs/git2/*/git2/build/struct.CheckoutBuilder.html#method.disable_filters) ➡ ❌ *(filters are always applied during checkouts)*
|
69 |
| -//! * [`git2::Odb::read_header()`](https://docs.rs/git2/*/git2/struct.Odb.html#method.read_header) ➡ [`Repository::find_header()`] |
70 |
| -//! * [`git2::Repository::submodules()`](https://docs.rs/git2/*/git2/struct.Repository.html#method.submodules) ➡ [`Repository::submodules()`] |
71 |
| -//! * [`git2::Repository::submodules()`](https://docs.rs/git2/*/git2/struct.Repository.html#method.submodules) ➡ [`Repository::submodules()`] |
72 | 65 | //! * [`git2::Repository::submodule_status()`](https://docs.rs/git2/*/git2/struct.Repository.html#method.submodule_status) ➡ [`Submodule::state()`] - status provides more information and conveniences though, and an actual worktree status isn't performed.
|
73 | 66 | //!
|
74 | 67 | //! ## Feature Flags
|
@@ -234,12 +227,14 @@ fn open_opts_with_git_binary_config() -> open::Options {
|
234 | 227 |
|
235 | 228 | /// See [`ThreadSafeRepository::open()`], but returns a [`Repository`] instead.
|
236 | 229 | #[allow(clippy::result_large_err)]
|
| 230 | +#[doc(alias = "git2")] |
237 | 231 | pub fn open(directory: impl Into<std::path::PathBuf>) -> Result<Repository, open::Error> {
|
238 | 232 | ThreadSafeRepository::open(directory).map(Into::into)
|
239 | 233 | }
|
240 | 234 |
|
241 | 235 | /// See [`ThreadSafeRepository::open_opts()`], but returns a [`Repository`] instead.
|
242 | 236 | #[allow(clippy::result_large_err)]
|
| 237 | +#[doc(alias = "open_ext", alias = "git2")] |
243 | 238 | pub fn open_opts(directory: impl Into<std::path::PathBuf>, options: open::Options) -> Result<Repository, open::Error> {
|
244 | 239 | ThreadSafeRepository::open_opts(directory, options).map(Into::into)
|
245 | 240 | }
|
|
0 commit comments