History

Apply `momo` to mod `gix::open::repository`

to: - `ThreadSafeRepository::open_opts` - `ThreadSafeRepository::open_with_environment_overrides`

Jiahao XU committed 3 years ago

Commit 3ce01441 parent d8355261 file · +4 −0Browse files

Unified · Split

gix/src/open/repository.rs+4−0
@@ -2,6 +2,7 @@ · 1 unmodified line
2use std::{borrow::Cow, path::PathBuf};2use std::{borrow::Cow, path::PathBuf};
3 3
4use gix_features::threading::OwnShared;4use gix_features::threading::OwnShared;
5use gix_macros::momo;
5 6
6use super::{Error, Options};7use super::{Error, Options};
7use crate::{8use crate::{
@@ -58,6 +59,8 @@ impl ThreadSafeRepository { · 50 unmodified lines
58 ///59 ///
59 /// Note that opening a repository for implementing custom hooks is also handle specifically in60 /// Note that opening a repository for implementing custom hooks is also handle specifically in
60 /// [`open_with_environment_overrides()`][Self::open_with_environment_overrides()].61 /// [`open_with_environment_overrides()`][Self::open_with_environment_overrides()].
62 #[momo]
63 #[allow(unused_mut)]
61 pub fn open_opts(path: impl Into<PathBuf>, mut options: Options) -> Result<Self, Error> {64 pub fn open_opts(path: impl Into<PathBuf>, mut options: Options) -> Result<Self, Error> {
62 let _span = gix_trace::coarse!("ThreadSafeRepository::open()");65 let _span = gix_trace::coarse!("ThreadSafeRepository::open()");
63 let (path, kind) = {66 let (path, kind) = {
@@ -109,6 +112,7 @@ impl ThreadSafeRepository { · 45 unmodified lines
109 // GIT_PROXY_SSL_CERT, GIT_PROXY_SSL_KEY, GIT_PROXY_SSL_CERT_PASSWORD_PROTECTED.112 // GIT_PROXY_SSL_CERT, GIT_PROXY_SSL_KEY, GIT_PROXY_SSL_CERT_PASSWORD_PROTECTED.
110 // GIT_PROXY_SSL_CAINFO, GIT_SSL_CIPHER_LIST, GIT_HTTP_MAX_REQUESTS, GIT_CURL_FTP_NO_EPSV,113 // GIT_PROXY_SSL_CAINFO, GIT_SSL_CIPHER_LIST, GIT_HTTP_MAX_REQUESTS, GIT_CURL_FTP_NO_EPSV,
111 #[doc(alias = "open_from_env", alias = "git2")]114 #[doc(alias = "open_from_env", alias = "git2")]
115 #[momo]
112 pub fn open_with_environment_overrides(116 pub fn open_with_environment_overrides(
113 fallback_directory: impl Into<PathBuf>,117 fallback_directory: impl Into<PathBuf>,
114 trust_map: gix_sec::trust::Mapping<Options>,118 trust_map: gix_sec::trust::Mapping<Options>,