Skip to content

web: Handle uncloned repository which isn't yet cloning

Administrator requested to merge core/empty-repo into master

Created by: keegancsmith

A repository may be in the queue to be cloned, but not yet cloning. As such the cloneInProgress value will be false. The error checking code in the webapp would treat cloneInProgress being false as the repo is cloned. Therefore it treated resolveRev to uncloned repositories as a missing revision.

The only way to get back missing revision when resolveRev on the default branch, is if the repository has no commits. So this lead to uncloned repositories being reported as empty repositories.

This commit checks if the repository is cloned. If not, it returns a CloneInProgressError. This seems a bit hacky, but in fact works well. Since the page presented will update when the repository is cloning. Additionally the repository is placed in the high priority clone queue.

Test plan: Added a large number of repositories to be cloned. Visited a non-cloned repository and observed fixed behaviour.

Kapture 2019-06-03 at 21 24 59

Fixes https://github.com/sourcegraph/sourcegraph/issues/1744

Merge request reports

Loading