diff --git a/kythe/go/serving/filetree/filetree.go b/kythe/go/serving/filetree/filetree.go index 0c9e29dde9..2d9628e079 100644 --- a/kythe/go/serving/filetree/filetree.go +++ b/kythe/go/serving/filetree/filetree.go @@ -78,6 +78,9 @@ func (t *Table) Directory(ctx context.Context, req *ftpb.DirectoryRequest) (*ftp } entries := make([]*ftpb.DirectoryReply_Entry, 0, len(d.Entry)) for _, e := range d.Entry { + if !req.GetIncludeFilesMissingText() && e.GetMissingText() { + continue + } re := &ftpb.DirectoryReply_Entry{ Name: e.Name, BuildConfig: e.BuildConfig, @@ -87,9 +90,6 @@ func (t *Table) Directory(ctx context.Context, req *ftpb.DirectoryRequest) (*ftp switch e.Kind { case srvpb.FileDirectory_FILE: re.Kind = ftpb.DirectoryReply_FILE - if !req.GetIncludeFilesMissingText() && e.GetMissingText() { - continue - } case srvpb.FileDirectory_DIRECTORY: re.Kind = ftpb.DirectoryReply_DIRECTORY default: diff --git a/kythe/proto/filetree.proto b/kythe/proto/filetree.proto index c75ca01c4c..74d96f65cd 100644 --- a/kythe/proto/filetree.proto +++ b/kythe/proto/filetree.proto @@ -81,7 +81,8 @@ message DirectoryReply { // True if the entry is generated. bool generated = 4; - // Whether the FILE entry is missing text. + // Whether the FILE entry is missing text or the DIRECTORY entry contains + // only entries with missing_text. bool missing_text = 5; } enum Kind {