diff options
| author | Teddy Wing | 2020-08-23 17:41:37 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2020-08-23 17:41:37 +0200 | 
| commit | 588cd526fd78b3a0e0ec1dfb9fc194ca385de902 (patch) | |
| tree | ec5e973c273581c94e2bd8b5a95664cb9ba37d0a /src/bin | |
| parent | 3c6f337e26964077d1ce629fa17d16e4484b877f (diff) | |
| download | git-suggestion-588cd526fd78b3a0e0ec1dfb9fc194ca385de902.tar.bz2 | |
Suggestion.diff_command: Diff an index instead of a file
This will enable us to use the `git diff` command with more than one
suggestion at the same time.
We compare the commit of the suggestion with the new index's tree.
And as I write this, I'm realising that we can't diff multiple
suggestions using the same commit because each suggestion has its own
commit.
Need to work out a different way to do this.
Diffstat (limited to 'src/bin')
| -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 9c7ff1f..362eb15 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 blob = suggestion.diff_command().unwrap(); +            let tree = suggestion.diff_command().unwrap();              Command::new("git")                  .arg("diff") -                .arg(format!("{}:{}", suggestion.commit(), suggestion.path())) -                .arg(blob.to_string()) +                .arg(suggestion.commit()) +                .arg(tree.to_string())                  .spawn()                  .unwrap();          }, | 
