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 /github-suggestion/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 'github-suggestion/src')
| -rw-r--r-- | github-suggestion/src/suggestion.rs | 22 | 
1 files changed, 1 insertions, 21 deletions
| diff --git a/github-suggestion/src/suggestion.rs b/github-suggestion/src/suggestion.rs index 29fab04..21591b1 100644 --- a/github-suggestion/src/suggestion.rs +++ b/github-suggestion/src/suggestion.rs @@ -157,27 +157,7 @@ impl Suggestion {                  message: "unable to read right side of patch".to_owned(),              })?; -        let mut index = repo.index()?; -        index.add_frombuffer( -            &git2::IndexEntry { -                ctime: git2::IndexTime::new(0, 0), -                mtime: git2::IndexTime::new(0, 0), -                dev: 0, -                ino: 0, -                mode: 0o100644, -                uid: 0, -                gid: 0, -                file_size: new_buffer.len() as u32, -                id: git2::Oid::zero(), -                flags: 0, -                flags_extended: 0, -                path: self.path.as_bytes().to_vec(), -            }, -            &new_buffer, -        )?; -        let tree = index.write_tree()?; - -        Ok(tree) +        Ok(repo.blob(&new_buffer)?)      }      /// Extract suggestion code from a comment body. | 
