We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9fed464 commit 2519810Copy full SHA for 2519810
asyncgit/src/sync/commit_files.rs
@@ -54,17 +54,16 @@ pub(crate) fn get_commit_diff(
54
None
55
};
56
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
- });
+ let mut opts = DiffOptions::new();
+ if let Some(p) = &pathspec {
+ opts.pathspec(p.clone());
+ }
+ opts.show_binary(true);
63
64
let mut diff = repo.diff_tree_to_tree(
65
parent.as_ref(),
66
Some(&commit_tree),
67
- opt.as_mut(),
+ Some(&mut opts),
68
)?;
69
70
if is_stash_commit(
0 commit comments