fix: only skip big files from snapshotting if they are untracked

This commit is contained in:
Kiril Videlov 2024-05-04 16:28:34 +02:00
parent 027e0bec05
commit 105a355e5d
No known key found for this signature in database

View File

@ -225,7 +225,10 @@ fn get_exclude_list(repo: &git2::Repository) -> Result<String> {
if let Some(path) = entry.path() {
let path = repo_path.join(path);
if let Ok(metadata) = fs::metadata(&path) {
if metadata.is_file() && metadata.len() > SNAPSHOT_FILE_LIMIT_BYTES {
if metadata.is_file()
&& metadata.len() > SNAPSHOT_FILE_LIMIT_BYTES
&& entry.status().is_wt_new()
{
files_to_exclude.push(path);
}
}