mirror of
https://github.com/TabbyML/tabby
synced 2024-11-23 10:05:08 +00:00
refactor: mark RepositoryConfig::name private (#1125)
This commit is contained in:
parent
8d20068e34
commit
e2eda29e3b
@ -45,11 +45,19 @@ impl Config {
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct RepositoryConfig {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
name: Option<String>,
|
||||
pub git_url: String,
|
||||
}
|
||||
|
||||
impl RepositoryConfig {
|
||||
#[cfg(feature = "testutils")]
|
||||
pub fn new(git_url: String) -> Self {
|
||||
Self {
|
||||
name: None,
|
||||
git_url,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn dir(&self) -> PathBuf {
|
||||
if self.is_local_dir() {
|
||||
let path = self.git_url.strip_prefix("file://").unwrap();
|
||||
|
@ -17,10 +17,9 @@ mod tests {
|
||||
set_tabby_root(root.to_path_buf());
|
||||
|
||||
let config = Config {
|
||||
repositories: vec![RepositoryConfig {
|
||||
name: None,
|
||||
git_url: "https://github.com/TabbyML/interview-questions".to_owned(),
|
||||
}],
|
||||
repositories: vec![RepositoryConfig::new(
|
||||
"https://github.com/TabbyML/interview-questions".to_owned(),
|
||||
)],
|
||||
server: ServerConfig::default(),
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user