slothfs/gitiles: add HTTP client to service opts

This allows clients to provide their own HTTP clients for the gitiles
library to use instead of the default client. This is useful for clients
where authentication cannot be handled by the CookieJar.

Change-Id: Iff087d8fe5fbfcb6ed240195038eb98f217303e5
diff --git a/gitiles/client.go b/gitiles/client.go
index 90c4f54..9cb6d0f 100644
--- a/gitiles/client.go
+++ b/gitiles/client.go
@@ -62,6 +62,9 @@
 	// UserAgent defines how we present ourself to the server.
 	UserAgent string
 
+	// HTTPClient allows callers to present their own http.Client instead of the default.
+	HTTPClient http.Client
+
 	Debug bool
 }
 
@@ -109,6 +112,7 @@
 		limiter: rate.NewLimiter(rate.Limit(opts.SustainedQPS), opts.BurstQPS),
 		addr:    *url,
 		agent:   opts.UserAgent,
+		client:  opts.HTTPClient,
 	}
 
 	s.client.Jar = jar