Merge pull request #3775 from gitbutlerapp/add-snapshot-lines-threshold-option

feat: Add support for setting snapshot_lines_threshold in UpdateRequest
This commit is contained in:
Kiril Videlov 2024-05-17 12:57:39 +02:00 committed by GitHub
commit 214706a608
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,6 +26,7 @@ pub struct UpdateRequest {
pub project_data_last_fetched: Option<project::FetchResult>,
pub omit_certificate_check: Option<bool>,
pub use_diff_context: Option<bool>,
pub snapshot_lines_threshold: Option<usize>,
}
#[derive(Debug, thiserror::Error)]
@ -125,6 +126,10 @@ impl Storage {
project.omit_certificate_check = Some(omit_certificate_check);
}
if let Some(snapshot_lines_threshold) = update_request.snapshot_lines_threshold {
project.snapshot_lines_threshold = Some(snapshot_lines_threshold);
}
self.inner
.write(PROJECTS_FILE, &serde_json::to_string_pretty(&projects)?)?;