Skip to content

Commit 86c7fa1

Browse files
committed
Add config section for mailmap.{blob,file}.
These keys are not used at the moment, but will be introduced as part of the work performed under #1125.
1 parent 281fda0 commit 86c7fa1

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

gix/src/config/tree/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ pub(crate) mod root {
4545
pub const INDEX: sections::Index = sections::Index;
4646
/// The `init` section.
4747
pub const INIT: sections::Init = sections::Init;
48+
/// The `mailmap` section.
49+
pub const MAILMAP: sections::Mailmap = sections::Mailmap;
4850
/// The `pack` section.
4951
pub const PACK: sections::Pack = sections::Pack;
5052
/// The `protocol` section.
@@ -78,6 +80,7 @@ pub(crate) mod root {
7880
&Self::HTTP,
7981
&Self::INDEX,
8082
&Self::INIT,
83+
&Self::MAILMAP,
8184
&Self::PACK,
8285
&Self::PROTOCOL,
8386
&Self::REMOTE,
@@ -93,8 +96,8 @@ pub(crate) mod root {
9396
mod sections;
9497
pub use sections::{
9598
branch, checkout, core, credential, extensions, fetch, gitoxide, http, index, protocol, remote, ssh, Author,
96-
Branch, Checkout, Clone, Committer, Core, Credential, Extensions, Fetch, Gitoxide, Http, Index, Init, Pack,
97-
Protocol, Remote, Safe, Ssh, Url, User,
99+
Branch, Checkout, Clone, Committer, Core, Credential, Extensions, Fetch, Gitoxide, Http, Index, Init, Mailmap,
100+
Pack, Protocol, Remote, Safe, Ssh, Url, User,
98101
};
99102
#[cfg(feature = "blob-diff")]
100103
pub use sections::{diff, Diff};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use crate::config::{
2+
tree::{keys, Key, Mailmap, Section},
3+
Tree,
4+
};
5+
6+
impl Mailmap {
7+
/// The `mailmap.blob` key
8+
pub const BLOB: keys::Any = keys::Any::new("blob", &Tree::MAILMAP);
9+
/// The `mailmap.file` key
10+
pub const FILE: keys::Any = keys::Any::new("file", &Tree::MAILMAP);
11+
}
12+
13+
impl Section for Mailmap {
14+
fn name(&self) -> &str {
15+
"mailmap"
16+
}
17+
18+
fn keys(&self) -> &[&dyn Key] {
19+
&[&Self::BLOB, &Self::FILE]
20+
}
21+
}

gix/src/config/tree/sections/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ pub mod index;
7272
pub struct Init;
7373
mod init;
7474

75+
#[derive(Copy, Clone, Default)]
76+
pub struct Mailmap;
77+
mod mailmap;
78+
7579
/// The `pack` top-level section.
7680
#[derive(Copy, Clone, Default)]
7781
pub struct Pack;

0 commit comments

Comments
 (0)