Skip to content

Commit 2519810

Browse files
author
Stephan Dilly
committed
cleanup
1 parent 9fed464 commit 2519810

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

asyncgit/src/sync/commit_files.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,16 @@ pub(crate) fn get_commit_diff(
5454
None
5555
};
5656

57-
let mut opt = pathspec.as_ref().map(|p| {
58-
let mut opts = DiffOptions::new();
59-
opts.pathspec(p);
60-
opts.show_binary(true);
61-
opts
62-
});
57+
let mut opts = DiffOptions::new();
58+
if let Some(p) = &pathspec {
59+
opts.pathspec(p.clone());
60+
}
61+
opts.show_binary(true);
6362

6463
let mut diff = repo.diff_tree_to_tree(
6564
parent.as_ref(),
6665
Some(&commit_tree),
67-
opt.as_mut(),
66+
Some(&mut opts),
6867
)?;
6968

7069
if is_stash_commit(

0 commit comments

Comments
 (0)