aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config/mod.rs20
-rw-r--r--src/error/mod.rs5
2 files changed, 21 insertions, 4 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 07c6c29..f9ae103 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -16,6 +16,7 @@ use std::{
};
use git_bug::{entities::issue::Issue, replica::Replica};
+use log::info;
use serde::Deserialize;
use url::Url;
@@ -81,6 +82,7 @@ impl BackRepositories {
#[derive(Debug)]
pub struct BackRepository {
+ /// The path to the repository, with a possible `.git` suffix stripped.
repo_path: PathBuf,
}
@@ -139,9 +141,21 @@ impl BackConfig {
})?
.lines()
.try_fold(vec![], |mut acc, path| {
- acc.push(BackRepository {
- repo_path: PathBuf::from(path),
- });
+ let mut path = PathBuf::from(path);
+
+ let repo_path = if path
+ .extension()
+ .is_some_and(|ext| ext.eq_ignore_ascii_case("git"))
+ {
+ info!("Removing a `.git` suffix from path: {}", path.display());
+
+ path.set_extension("");
+ path
+ } else {
+ path
+ };
+
+ acc.push(BackRepository { repo_path });
Ok::<_, Error>(acc)
})?;
diff --git a/src/error/mod.rs b/src/error/mod.rs
index f109e11..0d25d90 100644
--- a/src/error/mod.rs
+++ b/src/error/mod.rs
@@ -58,7 +58,10 @@ pub enum Error {
#[error("while trying to read an identity's data from a replica: {0}")]
RepoIdentityRead(#[from] replica::entity::read::Error<Identity>),
- #[error("failed to find the repository at path: '{repository_path}'")]
+ #[error(
+ "failed to find the repository at path: '{repository_path}' (Not registered in \
+ projects.list)"
+ )]
RepoFind { repository_path: PathBuf },
#[error("while iteration over the refs in a repository: {0}")]