aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin
diff options
context:
space:
mode:
authorTeddy Wing2020-08-23 18:12:29 +0200
committerTeddy Wing2020-08-23 18:12:33 +0200
commit4c15bad2a95768ab6e299866c55aed31215fe6cc (patch)
treed61f1039aa25d01ff5dc354c25a0e936590e6b7b /src/bin
parent588cd526fd78b3a0e0ec1dfb9fc194ca385de902 (diff)
downloadgit-suggestion-4c15bad2a95768ab6e299866c55aed31215fe6cc.tar.bz2
Revert "Suggestion.diff_command: Diff an index instead of a file"
This reverts commit 588cd526fd78b3a0e0ec1dfb9fc194ca385de902. Since each suggestion has its own associated commit, we can't compare a tree and a single commit. We'll probably have to invoke `git diff` once for each suggestion.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/git-sugdiff.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/git-sugdiff.rs b/src/bin/git-sugdiff.rs
index 362eb15..9c7ff1f 100644
--- a/src/bin/git-sugdiff.rs
+++ b/src/bin/git-sugdiff.rs
@@ -43,12 +43,12 @@ fn main() {
&config,
|suggestion| {
// TODO: Needs to work for multiple suggestions at once
- let tree = suggestion.diff_command().unwrap();
+ let blob = suggestion.diff_command().unwrap();
Command::new("git")
.arg("diff")
- .arg(suggestion.commit())
- .arg(tree.to_string())
+ .arg(format!("{}:{}", suggestion.commit(), suggestion.path()))
+ .arg(blob.to_string())
.spawn()
.unwrap();
},