Skip to content

Commit 58fbb08

Browse files
committed
Apply momo to mod gix::discover
to: - `ThreadSafeRepository::discover_opts` - `ThreadSafeRepository::discover_with_environment_overrides_opts` Signed-off-by: Jiahao XU <[email protected]>
1 parent 6dae9e9 commit 58fbb08

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

gix/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ fast-sha1 = [ "gix-features/fast-sha1" ]
126126

127127

128128
[dependencies]
129+
gix-macros = { version = "^0.0.0", path = "../gix-macros" }
129130
gix-utils = { version = "^0.1.5", path = "../gix-utils" }
130131
gix-fs = { version = "^0.5.0", path = "../gix-fs" }
131132
gix-ref = { version = "^0.35.0", path = "../gix-ref" }

gix/src/discover.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
use std::path::Path;
33

44
pub use gix_discover::*;
5+
use gix_macros::momo;
56

67
use crate::{bstr::BString, ThreadSafeRepository};
78

@@ -31,6 +32,7 @@ impl ThreadSafeRepository {
3132
/// if the directory that is discovered can indeed be trusted (or else they'd have to implement the discovery themselves
3233
/// and be sure that no attacker ever gets access to a directory structure. The cost of this is a permission check, which
3334
/// seems acceptable).
35+
#[momo]
3436
pub fn discover_opts(
3537
directory: impl AsRef<Path>,
3638
options: upwards::Options<'_>,
@@ -61,6 +63,8 @@ impl ThreadSafeRepository {
6163
///
6264
/// Finally, use the `trust_map` to determine which of our own repository options to use
6365
/// based on the trust level of the effective repository directory.
66+
#[momo]
67+
#[allow(unused_mut)]
6468
pub fn discover_with_environment_overrides_opts(
6569
directory: impl AsRef<Path>,
6670
mut options: upwards::Options<'_>,

0 commit comments

Comments
 (0)