Chromium Code Reviews| Index: go/src/infra/libs/git/diff.go |
| diff --git a/go/src/infra/libs/git/diff.go b/go/src/infra/libs/git/diff.go |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d09d8aac2eeba3842416ee07d43e96bdaba89d47 |
| --- /dev/null |
| +++ b/go/src/infra/libs/git/diff.go |
| @@ -0,0 +1,12 @@ |
| +package git |
| + |
| +import "fmt" |
| +import "strings" |
| + |
| +func (r *Repo) GetTextDiff(left, right string) []string { |
|
M-A Ruel
2014/10/18 00:47:05
Why not implement in repo.go or where ever you def
M-A Ruel
2014/10/18 00:47:05
Why []string instead of string?
iannucci
2014/10/20 21:11:57
Fair enough.
iannucci
2014/10/20 21:11:57
Done.
|
| + rslt, ok := r.Run("diff", left, right) |
| + if !ok { |
| + panic(fmt.Errorf("cannot diff(%s, %s): %s", left, right, rslt)) |
|
M-A Ruel
2014/10/18 00:47:05
No, change the signature to return ([]string, erro
iannucci
2014/10/20 21:11:57
Done.
|
| + } |
| + return strings.Split(rslt, "\n") |
|
M-A Ruel
2014/10/18 00:47:05
return strings.Split(rslt, "\n"), nil
iannucci
2014/10/20 21:11:57
Done.
|
| +} |