| Index: milo/git/history.go
|
| diff --git a/milo/git/history.go b/milo/git/history.go
|
| index efcfb200e532d8dd83fdedb30322c1cc191b6ede..aaaa6f8ab8764cc25e9e45100557c0259a76271a 100644
|
| --- a/milo/git/history.go
|
| +++ b/milo/git/history.go
|
| @@ -20,6 +20,7 @@ import (
|
| "encoding/hex"
|
| "fmt"
|
| "io/ioutil"
|
| + "net/http"
|
| "regexp"
|
|
|
| "golang.org/x/net/context"
|
| @@ -32,6 +33,7 @@ import (
|
| "github.com/luci/luci-go/common/errors"
|
| "github.com/luci/luci-go/common/logging"
|
| "github.com/luci/luci-go/common/proto/google"
|
| + "github.com/luci/luci-go/server/auth"
|
|
|
| milo "github.com/luci/luci-go/milo/api/proto"
|
| )
|
| @@ -151,7 +153,17 @@ func GetHistory(c context.Context, url, commitish string, limit int) (*milo.Cons
|
| ret := &milo.ConsoleGitInfo{}
|
| cacheKey := fmt.Sprintf("GetHistory|%s|%s|%d", url, commitish, limit)
|
| err = protoCache(c, useCache, cacheKey, ret, func() error {
|
| - rawEntries, err := gitiles.Log(c, url, commitish, limit)
|
| + t, err := auth.GetRPCTransport(c, auth.AsSelf, auth.WithScopes(
|
| + "https://www.googleapis.com/auth/gerritcodereview",
|
| + ))
|
| + if err != nil {
|
| + return errors.Annotate(err, "getting RPC Transport").Err()
|
| + }
|
| + cl, err := gitiles.New(&http.Client{Transport: t}, url)
|
| + if err != nil {
|
| + return errors.Annotate(err, "repo URL not valid").Err()
|
| + }
|
| + rawEntries, err := cl.Log(c, commitish, limit)
|
| if err != nil {
|
| return errors.Annotate(err, "GetHistory").Err()
|
| }
|
|
|