feature flag for snapshot creation

This commit is contained in:
Kiril Videlov 2024-04-25 14:44:45 +02:00
parent 753953a7d5
commit 432aeeaf2a
2 changed files with 6 additions and 0 deletions

View File

@ -82,6 +82,8 @@ pub struct Project {
pub project_data_last_fetch: Option<FetchResult>, pub project_data_last_fetch: Option<FetchResult>,
#[serde(default)] #[serde(default)]
pub omit_certificate_check: Option<bool>, pub omit_certificate_check: Option<bool>,
#[serde(default)]
pub enable_snapshots: Option<bool>,
} }
impl AsRef<Project> for Project { impl AsRef<Project> for Project {

View File

@ -14,6 +14,10 @@ pub struct SnapshotEntry {
} }
pub fn create(project: Project, label: String) -> Result<()> { pub fn create(project: Project, label: String) -> Result<()> {
if let Some(false) = project.enable_snapshots {
return Ok(());
}
let repo_path = project.path.as_path(); let repo_path = project.path.as_path();
let repo = git2::Repository::init(repo_path)?; let repo = git2::Repository::init(repo_path)?;