aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/git-sugdiff.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/git-sugdiff.rs')
-rw-r--r--src/bin/git-sugdiff.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bin/git-sugdiff.rs b/src/bin/git-sugdiff.rs
index c8ecf40..9c7ff1f 100644
--- a/src/bin/git-sugdiff.rs
+++ b/src/bin/git-sugdiff.rs
@@ -16,6 +16,7 @@
use std::env;
use std::process;
+use std::process::Command;
use exitcode;
@@ -42,7 +43,14 @@ fn main() {
&config,
|suggestion| {
// TODO: Needs to work for multiple suggestions at once
- suggestion.diff_command().unwrap();
+ let blob = suggestion.diff_command().unwrap();
+
+ Command::new("git")
+ .arg("diff")
+ .arg(format!("{}:{}", suggestion.commit(), suggestion.path()))
+ .arg(blob.to_string())
+ .spawn()
+ .unwrap();
},
);
}