Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(747)

Unified Diff: go/src/infra/libs/git/diff.go

Issue 662113003: Drover's back, baby! (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git/+/master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
+}

Powered by Google App Engine
This is Rietveld 408576698