diff options
| author | Teddy Wing | 2020-08-23 18:12:29 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2020-08-23 18:12:33 +0200 | 
| commit | 4c15bad2a95768ab6e299866c55aed31215fe6cc (patch) | |
| tree | d61f1039aa25d01ff5dc354c25a0e936590e6b7b /src | |
| parent | 588cd526fd78b3a0e0ec1dfb9fc194ca385de902 (diff) | |
| download | git-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')
| -rw-r--r-- | src/bin/git-sugdiff.rs | 6 | 
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();          }, | 
