2024-05-11 19:46:20 +01:00
|
|
|
use crate::BranchName;
|
|
|
|
|
|
|
|
/// Mapped from `.git-next.toml` file at `branches`
|
2024-05-15 07:55:05 +01:00
|
|
|
#[derive(
|
2024-06-19 07:02:18 +01:00
|
|
|
Clone,
|
|
|
|
Hash,
|
|
|
|
Debug,
|
|
|
|
PartialEq,
|
|
|
|
Eq,
|
|
|
|
PartialOrd,
|
|
|
|
Ord,
|
|
|
|
serde::Deserialize,
|
|
|
|
serde::Serialize,
|
|
|
|
derive_more::Constructor,
|
|
|
|
derive_more::Display,
|
2024-05-15 07:55:05 +01:00
|
|
|
)]
|
2024-05-12 22:27:20 +01:00
|
|
|
#[display("{},{},{}", main, next, dev)]
|
2024-05-11 19:46:20 +01:00
|
|
|
pub struct RepoBranches {
|
2024-05-15 07:55:05 +01:00
|
|
|
main: String,
|
|
|
|
next: String,
|
|
|
|
dev: String,
|
2024-05-11 19:46:20 +01:00
|
|
|
}
|
|
|
|
impl RepoBranches {
|
|
|
|
pub fn main(&self) -> BranchName {
|
2024-05-12 22:27:20 +01:00
|
|
|
BranchName::new(&self.main)
|
2024-05-11 19:46:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn next(&self) -> BranchName {
|
2024-05-12 22:27:20 +01:00
|
|
|
BranchName::new(&self.next)
|
2024-05-11 19:46:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn dev(&self) -> BranchName {
|
2024-05-12 22:27:20 +01:00
|
|
|
BranchName::new(&self.dev)
|
2024-05-11 19:46:20 +01:00
|
|
|
}
|
|
|
|
}
|