gitai/remote/models/
repo_config.rs

1use serde::{Deserialize, Serialize};
2
3use crate::remote::common::Method;
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
6pub struct RepositoryConfiguration {
7    /// The URL of the remote repository
8    pub url: String,
9    /// The branch to pull from (default: main/master)
10    pub branch: String,
11    /// The local path where content should be placed
12    pub target_path: String,
13    /// Paths/filenames to include from the repository
14    pub filters: Vec<String>,
15    /// Specific commit to check out (optional)
16    pub commit_hash: Option<String>,
17    /// Method for cloning
18    pub mtd: Option<Method>,
19}
20
21impl RepositoryConfiguration {
22    pub fn new(
23        url: String,
24        branch: String,
25        target_path: String,
26        filters: Vec<String>,
27        commit_hash: Option<String>,
28        mtd: Option<Method>,
29    ) -> Self {
30        Self {
31            url,
32            branch,
33            target_path,
34            filters,
35            commit_hash,
36            mtd,
37        }
38    }
39}