mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-18 23:02:31 +03:00
feature flag for snapshot creation
This commit is contained in:
parent
753953a7d5
commit
432aeeaf2a
@ -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 {
|
||||||
|
@ -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)?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user