fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

grpc: FileMatch: tweak file_name to be bytes instead of string (#641)

+22 -8
+2 -2
api_proto.go
··· 37 37 return FileMatch{ 38 38 Score: p.GetScore(), 39 39 Debug: p.GetDebug(), 40 - FileName: p.GetFileName(), 40 + FileName: string(p.GetFileName()), // Note: 🚨Warning, this filename may be a non-UTF8 string. 41 41 Repository: p.GetRepository(), 42 42 Branches: p.GetBranches(), 43 43 LineMatches: lineMatches, ··· 67 67 return &proto.FileMatch{ 68 68 Score: m.Score, 69 69 Debug: m.Debug, 70 - FileName: m.FileName, 70 + FileName: []byte(m.FileName), 71 71 Repository: m.Repository, 72 72 Branches: m.Branches, 73 73 LineMatches: lineMatches,
+10
gen-proto.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + cd "$(dirname "${BASH_SOURCE[0]}")" 4 + set -euo pipefail 5 + 6 + find . -name "buf.gen.yaml" -not -path ".git" | while read -r buf_yaml; do 7 + pushd "$(dirname "${buf_yaml}")" >/dev/null 8 + buf generate 9 + popd >/dev/null 10 + done
+7 -5
grpc/v1/webserver.pb.go
··· 1558 1558 Score float64 `protobuf:"fixed64,1,opt,name=score,proto3" json:"score,omitempty"` 1559 1559 // For debugging. Needs DebugScore set, but public so tests in 1560 1560 // other packages can print some diagnostics. 1561 - Debug string `protobuf:"bytes,2,opt,name=debug,proto3" json:"debug,omitempty"` 1562 - FileName string `protobuf:"bytes,3,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` 1561 + Debug string `protobuf:"bytes,2,opt,name=debug,proto3" json:"debug,omitempty"` 1562 + // The repository-relative path to the file. 1563 + // 🚨 Warning: file_name might not be a valid UTF-8 string. 1564 + FileName []byte `protobuf:"bytes,3,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` 1563 1565 // Repository is the globally unique name of the repo of the 1564 1566 // match 1565 1567 Repository string `protobuf:"bytes,4,opt,name=repository,proto3" json:"repository,omitempty"` ··· 1634 1636 return "" 1635 1637 } 1636 1638 1637 - func (x *FileMatch) GetFileName() string { 1639 + func (x *FileMatch) GetFileName() []byte { 1638 1640 if x != nil { 1639 1641 return x.FileName 1640 1642 } 1641 - return "" 1643 + return nil 1642 1644 } 1643 1645 1644 1646 func (x *FileMatch) GetRepository() string { ··· 2539 2541 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, 2540 2542 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 2541 2543 0x62, 0x75, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 2542 - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 2544 + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 2543 2545 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 2544 2546 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 2545 2547 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03,
+3 -1
grpc/v1/webserver.proto
··· 380 380 // other packages can print some diagnostics. 381 381 string debug = 2; 382 382 383 - string file_name = 3; 383 + // The repository-relative path to the file. 384 + // 🚨 Warning: file_name might not be a valid UTF-8 string. 385 + bytes file_name = 3; 384 386 385 387 // Repository is the globally unique name of the repo of the 386 388 // match