Add default tracking configuration

This commit is contained in:
2021-12-23 18:33:14 +01:00
parent 27586b5ff0
commit b183590096
6 changed files with 382 additions and 48 deletions

View File

@@ -42,10 +42,20 @@ impl RepoError {
}
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct TrackingConfig {
pub default: bool,
pub default_remote: String,
pub default_remote_prefix: Option<String>,
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct WorktreeRootConfig {
pub persistent_branches: Option<Vec<String>>,
pub track: Option<TrackingConfig>,
}
pub fn read_worktree_root_config(worktree_root: &Path) -> Result<Option<WorktreeRootConfig>, String> {