diff --git a/CHANGELOG.md b/CHANGELOG.md index 54ada37d6b1..68e71e4f765 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ All notable changes to Sourcegraph are documented in this file. - The blame column no longer ignores whitespace-only changes by default. [#58134](https://github.com/sourcegraph/sourcegraph/pull/58134) - Long lines now wrap correctly in the diff view. [#58138](https://github.com/sourcegraph/sourcegraph/pull/58138) - Fixed an issue in the search input where pressing Enter after selecting a suggestion would sometimes insert another suggestions instead of submitting the query. [#58186](https://github.com/sourcegraph/sourcegraph/pull/58186) +- Fixed an issue where having sub-repo permissions enabled could cause repositories with a large number of files in directories to become unviewable. [#59420](https://github.com/sourcegraph/sourcegraph/pull/59420) ### Removed diff --git a/client/web/src/repo/tree/TreePagePanels.tsx b/client/web/src/repo/tree/TreePagePanels.tsx index 522745a5c6d..83085b5d648 100644 --- a/client/web/src/repo/tree/TreePagePanels.tsx +++ b/client/web/src/repo/tree/TreePagePanels.tsx @@ -158,7 +158,9 @@ export const FilesCard: FC = ({ entries, historyEntries, classNa const fileHistoryByPath = useMemo(() => { const fileHistoryByPath: Record = {} for (const entry of historyEntries || []) { - fileHistoryByPath[entry.path] = entry.history.nodes[0].commit + if (entry.history.nodes.length > 0) { + fileHistoryByPath[entry.path] = entry.history.nodes[0].commit + } } return fileHistoryByPath }, [historyEntries]) diff --git a/internal/gitserver/client.go b/internal/gitserver/client.go index 81da986d82c..f900c6c65db 100644 --- a/internal/gitserver/client.go +++ b/internal/gitserver/client.go @@ -1226,7 +1226,6 @@ func (c *clientImplementor) RepoCloneProgress(ctx context.Context, repos ...api. req := req p.Go(func(ctx context.Context) (*proto.RepoCloneProgressResponse, error) { return client.RepoCloneProgress(ctx, req) - }) } @@ -1239,13 +1238,11 @@ func (c *clientImplementor) RepoCloneProgress(ctx context.Context, repos ...api. Results: make(map[api.RepoName]*protocol.RepoCloneProgress), } for _, r := range res { - for repo, info := range r.Results { var rp protocol.RepoCloneProgress rp.FromProto(info) result.Results[api.RepoName(repo)] = &rp } - } return result, nil @@ -1595,7 +1592,6 @@ func (c *clientImplementor) GetObject(ctx context.Context, repo api.RepoName, ob grpcResp, err := client.GetObject(ctx, req.ToProto()) if err != nil { - return nil, err } diff --git a/internal/gitserver/commands.go b/internal/gitserver/commands.go index 1dd8cbc8fca..9cdd1439e38 100644 --- a/internal/gitserver/commands.go +++ b/internal/gitserver/commands.go @@ -1911,6 +1911,9 @@ var runCommitLog = func(ctx context.Context, cmd GitCommand, opt CommitsOptions) func parseCommitLogOutput(r io.Reader) ([]*wrappedCommit, error) { commitScanner := bufio.NewScanner(r) + // We use an increased buffer size since sub-repo permissions + // can result in very lengthy output. + commitScanner.Buffer(make([]byte, 0, 65536), 4294967296) commitScanner.Split(commitSplitFunc) var commits []*wrappedCommit