Skip to content

Commit 34dd8b2

Browse files
committed
fix: properly filter ignored files in sapling all-files
1 parent df79391 commit 34dd8b2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/sapling.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ impl version_control::System for Repo {
5959
cmd.current_dir(&self.root);
6060
let output = cmd.output()?;
6161
log_utils::ensure_output(&format!("{:?}", cmd), &output)?;
62-
let commit_files_str = std::str::from_utf8(&output.stdout)?;
63-
let commit_files: std::collections::HashSet<String> = commit_files_str
62+
let all_files_str = std::str::from_utf8(&output.stdout)?;
63+
let all_files: std::collections::HashSet<String> = all_files_str
6464
.split('\n')
6565
.map(|x| x.to_string())
66+
.filter(|line| !line.starts_with('I'))
6667
.map(|line| re.replace(&line, "").to_string())
6768
.filter(|line| !line.is_empty())
68-
.filter(|line| !line.starts_with('I'))
6969
.collect();
7070

71-
let filtered_commit_files = commit_files
71+
let filtered_all_files = all_files
7272
.into_iter()
7373
.map(|f| format!("{}", self.root.join(f).display()))
7474
.filter_map(|f| match path::AbsPath::try_from(&f) {
@@ -80,7 +80,7 @@ impl version_control::System for Repo {
8080
})
8181
.collect::<Vec<path::AbsPath>>();
8282

83-
Ok(filtered_commit_files)
83+
Ok(filtered_all_files)
8484
}
8585

8686
fn get_changed_files(&self, relative_to: Option<&str>) -> anyhow::Result<Vec<path::AbsPath>> {

0 commit comments

Comments
 (0)