aboutsummaryrefslogtreecommitdiff
path: root/git-codereview/util_test.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2015-11-05 15:02:37 -0500
committerAustin Clements <austin@google.com>2015-11-11 00:37:51 +0000
commit0d7a1437b7262e6eb433008f1187ff729ac867ca (patch)
tree9b323bdfc386a3e9adb7413774de73c90d18a56a /git-codereview/util_test.go
parent4a2b2fd69ccbe0e57e6bdecedacab520fd35b9c9 (diff)
downloadgo-x-review-0d7a1437b7262e6eb433008f1187ff729ac867ca.tar.xz
git-codereview: allow multiple commit hashes for submit
This adds support to the submit subcommand for passing and submitting multiple commit hashes. Change-Id: Id030b07cac21d11acbeb8015fde9cb9e1acb1479 Reviewed-on: https://go-review.googlesource.com/16674 Reviewed-by: Andrew Gerrand <adg@golang.org>
Diffstat (limited to 'git-codereview/util_test.go')
-rw-r--r--git-codereview/util_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/git-codereview/util_test.go b/git-codereview/util_test.go
index 400beb4..b010f08 100644
--- a/git-codereview/util_test.go
+++ b/git-codereview/util_test.go
@@ -6,6 +6,7 @@ package main
import (
"bytes"
+ "encoding/json"
"fmt"
"io/ioutil"
"net"
@@ -386,6 +387,7 @@ func (s *gerritServer) done() {
type gerritReply struct {
status int
body string
+ json interface{}
f func() gerritReply
}
@@ -413,6 +415,13 @@ func (s *gerritServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
if reply.status != 0 {
w.WriteHeader(reply.status)
}
+ if reply.json != nil {
+ body, err := json.Marshal(reply.json)
+ if err != nil {
+ dief("%v", err)
+ }
+ reply.body = ")]}'\n" + string(body)
+ }
if len(reply.body) > 0 {
w.Write([]byte(reply.body))
}