feat: add config to disable warnings around ghost snapshot (#8178)

This commit is contained in:
jif-oai
2025-12-17 18:50:22 +00:00
committed by GitHub
parent 167553f00d
commit 3d92b443b0
4 changed files with 52 additions and 34 deletions

View File

@@ -65,6 +65,7 @@ pub struct RestoreGhostCommitOptions<'a> {
pub struct GhostSnapshotConfig {
pub ignore_large_untracked_files: Option<i64>,
pub ignore_large_untracked_dirs: Option<i64>,
pub disable_warnings: bool,
}
impl Default for GhostSnapshotConfig {
@@ -72,6 +73,7 @@ impl Default for GhostSnapshotConfig {
Self {
ignore_large_untracked_files: Some(DEFAULT_IGNORE_LARGE_UNTRACKED_FILES),
ignore_large_untracked_dirs: Some(DEFAULT_IGNORE_LARGE_UNTRACKED_DIRS),
disable_warnings: false,
}
}
}
@@ -1164,6 +1166,7 @@ mod tests {
let snapshot_config = GhostSnapshotConfig {
ignore_large_untracked_files: Some(DEFAULT_IGNORE_LARGE_UNTRACKED_FILES),
ignore_large_untracked_dirs: Some(threshold),
disable_warnings: false,
};
let (ghost, _report) = create_ghost_commit_with_report(
&CreateGhostCommitOptions::new(repo).ghost_snapshot(snapshot_config),