diff options
author | Rubén Dávila <ruben@gitlab.com> | 2018-07-31 09:13:06 +0300 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2018-07-31 09:13:06 +0300 |
commit | 99524989a8af3dafe4a6ddef820ae9e1bb5ff73c (patch) | |
tree | 84760cfa57c565a2347a01d068892127de4db201 | |
parent | a294acb3d6311ee4c02fa1627bef5fcb0eec1098 (diff) |
Exclude non blob objects
-rw-r--r-- | internal/service/ref/list_new_objects.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/service/ref/list_new_objects.go b/internal/service/ref/list_new_objects.go index 836f4627d..8f0cdde56 100644 --- a/internal/service/ref/list_new_objects.go +++ b/internal/service/ref/list_new_objects.go @@ -40,14 +40,15 @@ func (s *server) ListNewObjects(in *pb.ListNewObjectsRequest, stream pb.RefServi parts := strings.Fields(line) if len(parts) == 2 { + path := []byte(parts[1]) info, err := batch.Info(parts[0]) if err != nil { return status.Errorf(codes.Internal, "ListNewObjects: catfile: %v", err) } - path := []byte(parts[1]) - - newBlobs = append(newBlobs, &pb.NewBlobObject{Oid: info.Oid, Size: info.Size, Path: path,}) + if info.Type == "blob" { + newBlobs = append(newBlobs, &pb.NewBlobObject{Oid: info.Oid, Size: info.Size, Path: path,}) + } } if i%10 == 0 { |