Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer (GitLab) <jacob@gitlab.com>2017-07-07 15:52:39 +0300
committerJacob Vosmaer (GitLab) <jacob@gitlab.com>2017-07-07 15:52:39 +0300
commitcbcff50dd2762241ecfe7a1bffa3c58baf6faf8d (patch)
treef0f696f2223d9441c56dde9e65baa6652fd852c1
parent5c83fc3e82d10e770455fc303dffb6a8ad148aff (diff)
parentca7734f5e77049691cdcd86c7c488882e88b2a8a (diff)
Merge branch 'blobservice-getblob' into 'master'
Implement BlobService.GetBlob See merge request !202
-rw-r--r--CHANGELOG.md5
-rw-r--r--internal/git/catfile/catfile.go42
-rw-r--r--internal/service/blob/get_blob.go94
-rw-r--r--internal/service/blob/get_blob_test.go146
-rw-r--r--internal/service/blob/server.go10
-rw-r--r--internal/service/blob/testdata/maintenance-md-blob.txt25
-rw-r--r--internal/service/blob/testhelper_test.go74
-rw-r--r--internal/service/commit/tree_entry.go61
-rw-r--r--internal/service/register.go4
-rw-r--r--vendor/gitlab.com/gitlab-org/gitaly-proto/go/VERSION2
-rw-r--r--vendor/gitlab.com/gitlab-org/gitaly-proto/go/blob.pb.go48
-rw-r--r--vendor/gitlab.com/gitlab-org/gitaly-proto/go/commit.pb.go19
-rw-r--r--vendor/gitlab.com/gitlab-org/gitaly-proto/go/shared.pb.go48
-rw-r--r--vendor/vendor.json10
14 files changed, 494 insertions, 94 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8354e12ac..956508984 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
# Gitaly changelog
+UNRELEASED
+
+- Implement BlobService.GetBlob
+ https://gitlab.com/gitlab-org/gitaly/merge_requests/202
+
v0.15.0
- Ensure that sub-processes inherit TZ environment variable
diff --git a/internal/git/catfile/catfile.go b/internal/git/catfile/catfile.go
new file mode 100644
index 000000000..880637acd
--- /dev/null
+++ b/internal/git/catfile/catfile.go
@@ -0,0 +1,42 @@
+package catfile
+
+import (
+ "bufio"
+ "fmt"
+ "strconv"
+ "strings"
+)
+
+// ObjectInfo represents a header returned by `git cat-file --batch`
+type ObjectInfo struct {
+ Oid string
+ Type string
+ Size int64
+}
+
+// ParseObjectInfo reads and parses one header line from `git cat-file --batch`
+func ParseObjectInfo(stdout *bufio.Reader) (*ObjectInfo, error) {
+ infoLine, err := stdout.ReadString('\n')
+ if err != nil {
+ return nil, fmt.Errorf("read info line: %v", err)
+ }
+
+ infoLine = strings.TrimSuffix(infoLine, "\n")
+ if strings.HasSuffix(infoLine, " missing") {
+ return &ObjectInfo{}, nil
+ }
+
+ info := strings.Split(infoLine, " ")
+
+ objectSizeStr := info[2]
+ objectSize, err := strconv.ParseInt(objectSizeStr, 10, 64)
+ if err != nil {
+ return nil, fmt.Errorf("parse object size: %v", err)
+ }
+
+ return &ObjectInfo{
+ Oid: info[0],
+ Type: info[1],
+ Size: objectSize,
+ }, nil
+}
diff --git a/internal/service/blob/get_blob.go b/internal/service/blob/get_blob.go
new file mode 100644
index 000000000..9ed179cf9
--- /dev/null
+++ b/internal/service/blob/get_blob.go
@@ -0,0 +1,94 @@
+package blob
+
+import (
+ "bufio"
+ "fmt"
+ "io"
+ "os/exec"
+
+ "gitlab.com/gitlab-org/gitaly/internal/git/catfile"
+ "gitlab.com/gitlab-org/gitaly/internal/helper"
+
+ pb "gitlab.com/gitlab-org/gitaly-proto/go"
+ "gitlab.com/gitlab-org/gitaly/streamio"
+
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+)
+
+func (s *server) GetBlob(in *pb.GetBlobRequest, stream pb.BlobService_GetBlobServer) error {
+ if err := validateRequest(in); err != nil {
+ return grpc.Errorf(codes.InvalidArgument, "GetBlob: %v", err)
+ }
+
+ repoPath, err := helper.GetRepoPath(in.Repository)
+ if err != nil {
+ return err
+ }
+
+ stdinReader, stdinWriter := io.Pipe()
+
+ cmdArgs := []string{"--git-dir", repoPath, "cat-file", "--batch"}
+ cmd, err := helper.NewCommand(exec.Command("git", cmdArgs...), stdinReader, nil, nil)
+ if err != nil {
+ return grpc.Errorf(codes.Internal, "GetBlob: cmd: %v", err)
+ }
+ defer cmd.Kill()
+ defer stdinWriter.Close()
+ defer stdinReader.Close()
+
+ if _, err := fmt.Fprintln(stdinWriter, in.Oid); err != nil {
+ return grpc.Errorf(codes.Internal, "GetBlob: stdin write: %v", err)
+ }
+ stdinWriter.Close()
+
+ stdout := bufio.NewReader(cmd)
+
+ objectInfo, err := catfile.ParseObjectInfo(stdout)
+ if err != nil {
+ return grpc.Errorf(codes.Internal, "GetBlob: %v", err)
+ }
+ if objectInfo.Type != "blob" {
+ return helper.DecorateError(codes.Unavailable, stream.Send(&pb.GetBlobResponse{}))
+ }
+
+ readLimit := objectInfo.Size
+ if in.Limit >= 0 && in.Limit < readLimit {
+ readLimit = in.Limit
+ }
+ firstMessage := &pb.GetBlobResponse{
+ Size: objectInfo.Size,
+ Oid: objectInfo.Oid,
+ }
+
+ if readLimit == 0 {
+ return helper.DecorateError(codes.Unavailable, stream.Send(firstMessage))
+ }
+
+ sw := streamio.NewWriter(func(p []byte) error {
+ msg := &pb.GetBlobResponse{}
+ if firstMessage != nil {
+ msg = firstMessage
+ firstMessage = nil
+ }
+ msg.Data = p
+ return stream.Send(msg)
+ })
+
+ n, err := io.Copy(sw, io.LimitReader(stdout, readLimit))
+ if err != nil {
+ return grpc.Errorf(codes.Unavailable, "GetBlob: send: %v", err)
+ }
+ if n != readLimit {
+ return grpc.Errorf(codes.Unavailable, "GetBlob: short send: %d/%d bytes", n, objectInfo.Size)
+ }
+
+ return nil
+}
+
+func validateRequest(in *pb.GetBlobRequest) error {
+ if len(in.GetOid()) == 0 {
+ return fmt.Errorf("empty Oid")
+ }
+ return nil
+}
diff --git a/internal/service/blob/get_blob_test.go b/internal/service/blob/get_blob_test.go
new file mode 100644
index 000000000..7ed3ea8d7
--- /dev/null
+++ b/internal/service/blob/get_blob_test.go
@@ -0,0 +1,146 @@
+package blob
+
+import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+ "testing"
+
+ pb "gitlab.com/gitlab-org/gitaly-proto/go"
+ "gitlab.com/gitlab-org/gitaly/internal/testhelper"
+ "gitlab.com/gitlab-org/gitaly/streamio"
+
+ "github.com/stretchr/testify/require"
+)
+
+func TestSuccessfulGetBlob(t *testing.T) {
+ client := newBlobClient(t)
+ maintenanceMdBlobData := testhelper.MustReadFile(t, "testdata/maintenance-md-blob.txt")
+ testCases := []struct {
+ desc string
+ oid string
+ contents []byte
+ size int
+ limit int
+ }{
+ {
+ desc: "unlimited fetch",
+ oid: "95d9f0a5e7bb054e9dd3975589b8dfc689e20e88",
+ limit: -1,
+ contents: maintenanceMdBlobData,
+ size: len(maintenanceMdBlobData),
+ },
+ {
+ desc: "limit larger than blob size",
+ oid: "95d9f0a5e7bb054e9dd3975589b8dfc689e20e88",
+ limit: len(maintenanceMdBlobData) + 1,
+ contents: maintenanceMdBlobData,
+ size: len(maintenanceMdBlobData),
+ },
+ {
+ desc: "limit zero",
+ oid: "95d9f0a5e7bb054e9dd3975589b8dfc689e20e88",
+ limit: 0,
+ size: len(maintenanceMdBlobData),
+ },
+ {
+ desc: "limit greater than zero, less than blob size",
+ oid: "95d9f0a5e7bb054e9dd3975589b8dfc689e20e88",
+ limit: 10,
+ contents: maintenanceMdBlobData[:10],
+ size: len(maintenanceMdBlobData),
+ },
+ {
+ desc: "large blob",
+ oid: "08cf843fd8fe1c50757df0a13fcc44661996b4df",
+ limit: 10,
+ contents: []byte{0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46},
+ size: 111803,
+ },
+ }
+ for _, tc := range testCases {
+ t.Log(tc.desc)
+ request := &pb.GetBlobRequest{
+ Repository: testRepo,
+ Oid: tc.oid,
+ Limit: int64(tc.limit),
+ }
+
+ stream, err := client.GetBlob(context.Background(), request)
+ require.NoError(t, err, "initiate RPC")
+
+ reportedSize, reportedOid, data, err := getBlob(stream)
+ require.NoError(t, err, "consume response")
+
+ require.Equal(t, int64(tc.size), reportedSize, "real blob size")
+
+ require.NotEmpty(t, reportedOid)
+ require.True(t, bytes.Equal(tc.contents, data), "returned data exactly as expected")
+ }
+}
+
+func TestGetBlobNotFound(t *testing.T) {
+ client := newBlobClient(t)
+
+ request := &pb.GetBlobRequest{
+ Repository: testRepo,
+ Oid: "doesnotexist",
+ }
+
+ stream, err := client.GetBlob(context.Background(), request)
+ require.NoError(t, err)
+
+ reportedSize, reportedOid, data, err := getBlob(stream)
+ require.NoError(t, err)
+
+ require.Zero(t, reportedSize)
+ require.Empty(t, reportedOid)
+ require.Zero(t, len(data))
+}
+
+func getBlob(stream pb.BlobService_GetBlobClient) (int64, string, []byte, error) {
+ firstResponse, err := stream.Recv()
+ if err != nil {
+ return 0, "", nil, err
+ }
+
+ data := &bytes.Buffer{}
+ _, err = data.Write(firstResponse.GetData())
+ if err != nil {
+ return 0, "", nil, err
+ }
+
+ reader := streamio.NewReader(func() ([]byte, error) {
+ response, err := stream.Recv()
+ if response.GetSize() != 0 {
+ return nil, fmt.Errorf("size may only be set in the first response message")
+ }
+ if len(response.GetOid()) != 0 {
+ return nil, fmt.Errorf("oid may only be set in the first response message")
+ }
+ return response.GetData(), err
+ })
+
+ _, err = io.Copy(data, reader)
+ return firstResponse.Size, firstResponse.Oid, data.Bytes(), err
+}
+
+func TestFailedGetBlobRequestDueToValidationError(t *testing.T) {
+ client := newBlobClient(t)
+ oid := "d42783470dc29fde2cf459eb3199ee1d7e3f3a72"
+
+ rpcRequests := []pb.GetBlobRequest{
+ {Repository: &pb.Repository{StorageName: "fake", RelativePath: "path"}, Oid: oid}, // Repository doesn't exist
+ {Repository: nil, Oid: oid}, // Repository is nil
+ {Repository: testRepo}, // Oid is empty
+ }
+
+ for _, rpcRequest := range rpcRequests {
+ stream, err := client.GetBlob(context.Background(), &rpcRequest)
+ require.NoError(t, err, rpcRequest)
+ _, err = stream.Recv()
+ require.NotEqual(t, io.EOF, err, rpcRequest)
+ require.Error(t, err, rpcRequest)
+ }
+}
diff --git a/internal/service/blob/server.go b/internal/service/blob/server.go
new file mode 100644
index 000000000..c7d160d5b
--- /dev/null
+++ b/internal/service/blob/server.go
@@ -0,0 +1,10 @@
+package blob
+
+import pb "gitlab.com/gitlab-org/gitaly-proto/go"
+
+type server struct{}
+
+// NewServer creates a new instance of a grpc BlobServer
+func NewServer() pb.BlobServiceServer {
+ return &server{}
+}
diff --git a/internal/service/blob/testdata/maintenance-md-blob.txt b/internal/service/blob/testdata/maintenance-md-blob.txt
new file mode 100644
index 000000000..95d9f0a5e
--- /dev/null
+++ b/internal/service/blob/testdata/maintenance-md-blob.txt
@@ -0,0 +1,25 @@
+# GitLab Maintenance Policy
+
+GitLab is a fast moving and evolving project. We currently don't have the
+resources to support many releases concurrently. We support exactly one stable
+release at any given time.
+
+GitLab follows the [Semantic Versioning](http://semver.org/) for its releases:
+`(Major).(Minor).(Patch)`.
+
+* **Major version**: Whenever there is something significant or any backwards
+ incompatible changes are introduced to the public API.
+* **Minor version**: When new, backwards compatible functionality is introduced
+ to the public API or a minor feature is introduced, or when a set of smaller
+ features is rolled out.
+* **Patch number**: When backwards compatible bug fixes are introduced that fix
+ incorrect behavior.
+
+The current stable release will receive security patches and bug fixes
+(eg. `5.0` -> `5.0.1`). Feature releases will mark the next supported stable
+release where the minor version is increased numerically by increments of one
+(eg. `5.0 -> 5.1`).
+
+We encourage everyone to run the latest stable release to ensure that you can easily upgrade to the most secure and feature rich GitLab experience. In order to make sure you can easily run the most recent stable release, we are working hard to keep the update process simple and reliable.
+
+More information about the release procedures can be found in the doc/release directory.
diff --git a/internal/service/blob/testhelper_test.go b/internal/service/blob/testhelper_test.go
new file mode 100644
index 000000000..a0b7d0561
--- /dev/null
+++ b/internal/service/blob/testhelper_test.go
@@ -0,0 +1,74 @@
+package blob
+
+import (
+ "net"
+ "os"
+ "path"
+ "testing"
+ "time"
+
+ log "github.com/Sirupsen/logrus"
+
+ "gitlab.com/gitlab-org/gitaly/internal/testhelper"
+
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/reflection"
+
+ pb "gitlab.com/gitlab-org/gitaly-proto/go"
+)
+
+const scratchDir = "testdata/scratch"
+
+var (
+ serverSocketPath = path.Join(scratchDir, "gitaly.sock")
+ testRepo *pb.Repository
+)
+
+func TestMain(m *testing.M) {
+ testRepo = testhelper.TestRepository()
+
+ if err := os.MkdirAll(scratchDir, 0755); err != nil {
+ log.WithError(err).Fatal("mkdirall failed")
+ }
+
+ os.Remove(serverSocketPath)
+ server := runBlobServer(m)
+ os.Exit(func() int {
+ defer func() {
+ server.Stop()
+ os.Remove(serverSocketPath)
+ }()
+
+ return m.Run()
+ }())
+}
+
+func runBlobServer(m *testing.M) *grpc.Server {
+ server := grpc.NewServer()
+ listener, err := net.Listen("unix", serverSocketPath)
+ if err != nil {
+ log.WithError(err).Fatal("failed to start server")
+ }
+
+ pb.RegisterBlobServiceServer(server, NewServer())
+ reflection.Register(server)
+
+ go server.Serve(listener)
+
+ return server
+}
+
+func newBlobClient(t *testing.T) pb.BlobServiceClient {
+ connOpts := []grpc.DialOption{
+ grpc.WithInsecure(),
+ grpc.WithDialer(func(addr string, _ time.Duration) (net.Conn, error) {
+ return net.Dial("unix", addr)
+ }),
+ }
+ conn, err := grpc.Dial(serverSocketPath, connOpts...)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ return pb.NewBlobServiceClient(conn)
+}
diff --git a/internal/service/commit/tree_entry.go b/internal/service/commit/tree_entry.go
index 8e6318071..c14c530c3 100644
--- a/internal/service/commit/tree_entry.go
+++ b/internal/service/commit/tree_entry.go
@@ -7,8 +7,8 @@ import (
"os/exec"
"path"
"strconv"
- "strings"
+ "gitlab.com/gitlab-org/gitaly/internal/git/catfile"
"gitlab.com/gitlab-org/gitaly/internal/helper"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
@@ -18,10 +18,9 @@ import (
"google.golang.org/grpc/codes"
)
-type objectInfo struct {
+type entryInfo struct {
objectType string
oid string
- size int64
mode int32
}
@@ -62,15 +61,15 @@ func (s *server) TreeEntry(in *pb.TreeEntryRequest, stream pb.CommitService_Tree
stdout := bufio.NewReader(cmd)
- treeInfo, err := parseObjectInfo(stdout)
+ treeInfo, err := catfile.ParseObjectInfo(stdout)
if err != nil {
return grpc.Errorf(codes.Internal, "TreeEntry: %v", err)
}
- if treeInfo.oid == "" {
+ if treeInfo.Oid == "" {
return sendNotFoundResponse(stream)
}
- treeEntryInfo, err := extractEntryInfoFromTreeData(stdout, treeInfo.size, baseName)
+ treeEntryInfo, err := extractEntryInfoFromTreeData(stdout, treeInfo.Size, baseName)
if err != nil {
return grpc.Errorf(codes.Internal, "TreeEntry: %v", err)
}
@@ -94,38 +93,38 @@ func (s *server) TreeEntry(in *pb.TreeEntryRequest, stream pb.CommitService_Tree
stdinWriter.Write([]byte(treeEntryInfo.oid))
stdinWriter.Close()
- objectInfo, err := parseObjectInfo(stdout)
+ objectInfo, err := catfile.ParseObjectInfo(stdout)
if err != nil {
return grpc.Errorf(codes.Internal, "TreeEntry: %v", err)
}
- if treeEntryInfo.objectType != objectInfo.objectType {
+ if treeEntryInfo.objectType != objectInfo.Type {
return grpc.Errorf(
codes.Internal,
"TreeEntry: mismatched object type: tree-oid=%s object-oid=%s entry-type=%s object-type=%s",
- treeEntryInfo.oid, objectInfo.oid, treeEntryInfo.objectType, objectInfo.objectType,
+ treeEntryInfo.oid, objectInfo.Oid, treeEntryInfo.objectType, objectInfo.Type,
)
}
- if objectInfo.objectType == "tree" {
+ if objectInfo.Type == "tree" {
response := &pb.TreeEntryResponse{
Type: pb.TreeEntryResponse_TREE,
- Oid: objectInfo.oid,
- Size: objectInfo.size,
+ Oid: objectInfo.Oid,
+ Size: objectInfo.Size,
Mode: treeEntryInfo.mode,
}
return helper.DecorateError(codes.Unavailable, stream.Send(response))
}
- dataLength := objectInfo.size
+ dataLength := objectInfo.Size
if in.Limit > 0 && dataLength > in.Limit {
dataLength = in.Limit
}
response := &pb.TreeEntryResponse{
Type: pb.TreeEntryResponse_BLOB,
- Oid: objectInfo.oid,
- Size: objectInfo.size,
+ Oid: objectInfo.Oid,
+ Size: objectInfo.Size,
Mode: treeEntryInfo.mode,
}
if dataLength == 0 {
@@ -165,33 +164,7 @@ func validateRequest(in *pb.TreeEntryRequest) error {
return nil
}
-func parseObjectInfo(stdout *bufio.Reader) (*objectInfo, error) {
- infoLine, err := stdout.ReadString('\n')
- if err != nil {
- return nil, fmt.Errorf("read info line: %v", err)
- }
-
- infoLine = strings.TrimSuffix(infoLine, "\n")
- if strings.HasSuffix(infoLine, " missing") {
- return &objectInfo{}, nil
- }
-
- info := strings.Split(infoLine, " ")
-
- objectSizeStr := info[2]
- objectSize, err := strconv.ParseInt(objectSizeStr, 10, 64)
- if err != nil {
- return nil, fmt.Errorf("parse object size: %v", err)
- }
-
- return &objectInfo{
- objectType: info[1],
- oid: info[0],
- size: objectSize,
- }, nil
-}
-
-func extractEntryInfoFromTreeData(stdout *bufio.Reader, treeSize int64, baseName string) (*objectInfo, error) {
+func extractEntryInfoFromTreeData(stdout *bufio.Reader, treeSize int64, baseName string) (*entryInfo, error) {
var modeBytes, path []byte
var objectType string
var err error
@@ -233,7 +206,7 @@ func extractEntryInfoFromTreeData(stdout *bufio.Reader, treeSize int64, baseName
}
if !entryFound {
- return &objectInfo{}, nil
+ return &entryInfo{}, nil
}
mode, err := strconv.ParseInt(string(modeBytes), 8, 32)
@@ -253,7 +226,7 @@ func extractEntryInfoFromTreeData(stdout *bufio.Reader, treeSize int64, baseName
objectType = "blob"
}
- return &objectInfo{
+ return &entryInfo{
objectType: objectType,
mode: int32(mode),
oid: oid,
diff --git a/internal/service/register.go b/internal/service/register.go
index 4557ba378..cb30f27ff 100644
--- a/internal/service/register.go
+++ b/internal/service/register.go
@@ -2,6 +2,7 @@ package service
import (
pb "gitlab.com/gitlab-org/gitaly-proto/go"
+ "gitlab.com/gitlab-org/gitaly/internal/service/blob"
"gitlab.com/gitlab-org/gitaly/internal/service/commit"
"gitlab.com/gitlab-org/gitaly/internal/service/diff"
"gitlab.com/gitlab-org/gitaly/internal/service/notifications"
@@ -36,6 +37,9 @@ func RegisterAll(grpcServer *grpc.Server) {
sshService := ssh.NewServer()
pb.RegisterSSHServiceServer(grpcServer, sshService)
+ blobService := blob.NewServer()
+ pb.RegisterBlobServiceServer(grpcServer, blobService)
+
// Deprecated Services
pb.RegisterNotificationsServer(grpcServer, renameadapter.NewNotificationAdapter(notificationsService))
pb.RegisterRefServer(grpcServer, renameadapter.NewRefAdapter(refService))
diff --git a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/VERSION b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/VERSION
index 54d1a4f2a..a803cc227 100644
--- a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/VERSION
+++ b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/VERSION
@@ -1 +1 @@
-0.13.0
+0.14.0
diff --git a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/blob.pb.go b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/blob.pb.go
index 0e477af4c..a2ce5b1c2 100644
--- a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/blob.pb.go
+++ b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/blob.pb.go
@@ -87,7 +87,10 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type GetBlobRequest struct {
Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"`
- Oid string `protobuf:"bytes,2,opt,name=oid" json:"oid,omitempty"`
+ // Object ID (SHA1) of the blob we want to get
+ Oid string `protobuf:"bytes,2,opt,name=oid" json:"oid,omitempty"`
+ // Maximum number of bytes we want to receive. Use '-1' to get the full blob no matter how big.
+ Limit int64 `protobuf:"varint,3,opt,name=limit" json:"limit,omitempty"`
}
func (m *GetBlobRequest) Reset() { *m = GetBlobRequest{} }
@@ -109,10 +112,20 @@ func (m *GetBlobRequest) GetOid() string {
return ""
}
+func (m *GetBlobRequest) GetLimit() int64 {
+ if m != nil {
+ return m.Limit
+ }
+ return 0
+}
+
type GetBlobResponse struct {
- Size int64 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"`
+ // Blob size; present only in first response message
+ Size int64 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"`
+ // Chunk of blob data
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
- Oid string `protobuf:"bytes,3,opt,name=oid" json:"oid,omitempty"`
+ // Object ID of the actual blob returned. Empty if no blob was found.
+ Oid string `protobuf:"bytes,3,opt,name=oid" json:"oid,omitempty"`
}
func (m *GetBlobResponse) Reset() { *m = GetBlobResponse{} }
@@ -254,18 +267,19 @@ var _BlobService_serviceDesc = grpc.ServiceDesc{
func init() { proto.RegisterFile("blob.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
- // 204 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4a, 0xca, 0xc9, 0x4f,
- 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4b, 0xcf, 0x2c, 0x49, 0xcc, 0xa9, 0x94, 0xe2,
- 0x29, 0xce, 0x48, 0x2c, 0x4a, 0x4d, 0x81, 0x88, 0x2a, 0x85, 0x71, 0xf1, 0xb9, 0xa7, 0x96, 0x38,
- 0xe5, 0xe4, 0x27, 0x05, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x08, 0x19, 0x71, 0x71, 0x15, 0xa5,
- 0x16, 0xe4, 0x17, 0x67, 0x96, 0xe4, 0x17, 0x55, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0x09,
- 0xe9, 0x41, 0x34, 0xeb, 0x05, 0xc1, 0x65, 0x82, 0x90, 0x54, 0x09, 0x09, 0x70, 0x31, 0xe7, 0x67,
- 0xa6, 0x48, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x06, 0x81, 0x98, 0x4a, 0xde, 0x5c, 0xfc, 0x70, 0x73,
- 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0x84, 0xb8, 0x58, 0x8a, 0x33, 0xab, 0x52, 0xc1, 0x46,
- 0x32, 0x07, 0x81, 0xd9, 0x20, 0xb1, 0x94, 0xc4, 0x92, 0x44, 0xb0, 0x4e, 0x9e, 0x20, 0x30, 0x1b,
- 0x66, 0x18, 0x33, 0xdc, 0x30, 0x23, 0x5f, 0x2e, 0x6e, 0x90, 0x49, 0xc1, 0xa9, 0x45, 0x65, 0x99,
- 0xc9, 0xa9, 0x42, 0x76, 0x5c, 0xec, 0x50, 0xb3, 0x85, 0xc4, 0x60, 0x0e, 0x43, 0xf5, 0x84, 0x94,
- 0x38, 0x86, 0x38, 0xc4, 0x11, 0x4a, 0x0c, 0x06, 0x8c, 0x49, 0x6c, 0x60, 0xaf, 0x1b, 0x03, 0x02,
- 0x00, 0x00, 0xff, 0xff, 0xd9, 0x00, 0x89, 0x74, 0x1e, 0x01, 0x00, 0x00,
+ // 217 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0x31, 0x4b, 0xc7, 0x30,
+ 0x10, 0xc5, 0x8d, 0xd1, 0xbf, 0x78, 0x2d, 0x2a, 0x87, 0x68, 0xe9, 0x54, 0x3a, 0x75, 0x2a, 0x52,
+ 0x77, 0x07, 0x17, 0x07, 0x71, 0x89, 0x9f, 0x20, 0xb1, 0x87, 0x06, 0xa2, 0x57, 0x93, 0x28, 0xd4,
+ 0x4f, 0x2f, 0x4d, 0x6c, 0x51, 0xdc, 0x5e, 0x5e, 0x92, 0xf7, 0x7b, 0x77, 0x00, 0xc6, 0xb1, 0xe9,
+ 0x27, 0xcf, 0x91, 0x71, 0xf7, 0x6c, 0xa3, 0x76, 0x73, 0x5d, 0x86, 0x17, 0xed, 0x69, 0xcc, 0x6e,
+ 0xeb, 0xe0, 0xe4, 0x8e, 0xe2, 0xad, 0x63, 0xa3, 0xe8, 0xfd, 0x83, 0x42, 0xc4, 0x01, 0xc0, 0xd3,
+ 0xc4, 0xc1, 0x46, 0xf6, 0x73, 0x25, 0x1a, 0xd1, 0x15, 0x03, 0xf6, 0xf9, 0x73, 0xaf, 0xb6, 0x1b,
+ 0xf5, 0xeb, 0x15, 0x9e, 0x81, 0x64, 0x3b, 0x56, 0xfb, 0x8d, 0xe8, 0x8e, 0xd5, 0x22, 0xf1, 0x1c,
+ 0x0e, 0x9d, 0x7d, 0xb5, 0xb1, 0x92, 0x8d, 0xe8, 0xa4, 0xca, 0x87, 0xf6, 0x1e, 0x4e, 0x37, 0x5a,
+ 0x98, 0xf8, 0x2d, 0x10, 0x22, 0x1c, 0x04, 0xfb, 0x45, 0x09, 0x24, 0x55, 0xd2, 0x8b, 0x37, 0xea,
+ 0xa8, 0x53, 0x5e, 0xa9, 0x92, 0x5e, 0x11, 0x72, 0x43, 0x0c, 0x0f, 0x50, 0x2c, 0x49, 0x8f, 0xe4,
+ 0x3f, 0xed, 0x13, 0xe1, 0x0d, 0x1c, 0xfd, 0x64, 0xe3, 0xc5, 0x5a, 0xf7, 0xef, 0x68, 0xf5, 0xe5,
+ 0x3f, 0x3f, 0x97, 0x68, 0xf7, 0xae, 0x84, 0xd9, 0xa5, 0x85, 0x5c, 0x7f, 0x07, 0x00, 0x00, 0xff,
+ 0xff, 0xab, 0x77, 0x1a, 0x6d, 0x34, 0x01, 0x00, 0x00,
}
diff --git a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/commit.pb.go b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/commit.pb.go
index 74004cd9d..bbce88fa7 100644
--- a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/commit.pb.go
+++ b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/commit.pb.go
@@ -96,9 +96,11 @@ func (m *CommitIsAncestorResponse) GetValue() bool {
type TreeEntryRequest struct {
Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"`
- Revision []byte `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"`
- Path []byte `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
- Limit int64 `protobuf:"varint,4,opt,name=limit" json:"limit,omitempty"`
+ // commit ID or refname
+ Revision []byte `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"`
+ // entry path relative to repository root
+ Path []byte `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
+ Limit int64 `protobuf:"varint,4,opt,name=limit" json:"limit,omitempty"`
}
func (m *TreeEntryRequest) Reset() { *m = TreeEntryRequest{} }
@@ -136,10 +138,13 @@ func (m *TreeEntryRequest) GetLimit() int64 {
type TreeEntryResponse struct {
Type TreeEntryResponse_ObjectType `protobuf:"varint,1,opt,name=type,enum=gitaly.TreeEntryResponse_ObjectType" json:"type,omitempty"`
- Oid string `protobuf:"bytes,2,opt,name=oid" json:"oid,omitempty"`
- Size int64 `protobuf:"varint,3,opt,name=size" json:"size,omitempty"`
- Mode int32 `protobuf:"varint,4,opt,name=mode" json:"mode,omitempty"`
- Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
+ // SHA1 object ID
+ Oid string `protobuf:"bytes,2,opt,name=oid" json:"oid,omitempty"`
+ Size int64 `protobuf:"varint,3,opt,name=size" json:"size,omitempty"`
+ // file mode
+ Mode int32 `protobuf:"varint,4,opt,name=mode" json:"mode,omitempty"`
+ // raw object contents
+ Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
}
func (m *TreeEntryResponse) Reset() { *m = TreeEntryResponse{} }
diff --git a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/shared.pb.go b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/shared.pb.go
index 55138c1f9..3df4fdc43 100644
--- a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/shared.pb.go
+++ b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/shared.pb.go
@@ -40,6 +40,7 @@ func (m *Repository) GetRelativePath() string {
type GitCommit struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Subject []byte `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
+ Body []byte `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
Author *CommitAuthor `protobuf:"bytes,4,opt,name=author" json:"author,omitempty"`
Committer *CommitAuthor `protobuf:"bytes,5,opt,name=committer" json:"committer,omitempty"`
ParentIds []string `protobuf:"bytes,6,rep,name=parent_ids,json=parentIds" json:"parent_ids,omitempty"`
@@ -64,6 +65,13 @@ func (m *GitCommit) GetSubject() []byte {
return nil
}
+func (m *GitCommit) GetBody() []byte {
+ if m != nil {
+ return m.Body
+ }
+ return nil
+}
+
func (m *GitCommit) GetAuthor() *CommitAuthor {
if m != nil {
return m.Author
@@ -143,26 +151,26 @@ func init() {
func init() { proto.RegisterFile("shared.proto", fileDescriptor7) }
var fileDescriptor7 = []byte{
- // 326 bytes of a gzipped FileDescriptorProto
+ // 335 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x51, 0xc1, 0x4a, 0xc3, 0x40,
0x10, 0x25, 0x69, 0x1a, 0xcd, 0x34, 0x8a, 0x2c, 0x3d, 0x84, 0x82, 0x58, 0xe3, 0xa5, 0x07, 0x49,
- 0xa1, 0x7e, 0x81, 0x88, 0x88, 0x1e, 0x44, 0x56, 0xef, 0x75, 0xda, 0xac, 0xc9, 0x4a, 0xb6, 0x1b,
- 0x76, 0x27, 0xc5, 0xfe, 0x98, 0xdf, 0x27, 0xdd, 0x6d, 0xd0, 0x93, 0xb7, 0x7d, 0x6f, 0xde, 0x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3b, 0xac, 0x3b, 0xb7, 0x68, 0xcc, 0x5d, 0x91, 0x87, 0x56,
+ 0x7d, 0xf3, 0x13, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x87, 0xe3, 0xb7, 0xfc, 0x01, 0x00, 0x00,
}
diff --git a/vendor/vendor.json b/vendor/vendor.json
index e155923ba..caa1cde00 100644
--- a/vendor/vendor.json
+++ b/vendor/vendor.json
@@ -191,12 +191,12 @@
"revisionTime": "2017-01-30T11:31:45Z"
},
{
- "checksumSHA1": "NaSZlvcNDt6xjUlowFsxvs78AwU=",
+ "checksumSHA1": "bZU+ZZjRT7lLoaM5MzvG89s4Z64=",
"path": "gitlab.com/gitlab-org/gitaly-proto/go",
- "revision": "c4481d2d5cda107e28c68c9bf6c373e413cf356e",
- "revisionTime": "2017-07-06T13:31:57Z",
- "version": "v0.13.0",
- "versionExact": "v0.13.0"
+ "revision": "e73c809c669748d0f49e257a249c4c12b59f7968",
+ "revisionTime": "2017-07-07T12:10:40Z",
+ "version": "v0.14.0",
+ "versionExact": "v0.14.0"
},
{
"checksumSHA1": "GkeSZfXVbtAkBZOrswot19GJZqQ=",