gitserver: internal git clone
Created by: keegancsmith
We currently use git archives in most of our stack. However, we would like to index multiple branches at once in Zoekt. It is more convenient to pass Zoekt a repository in this case, rather than fetching multiple archives and merging them.
We ensure our smart handler is git protocol v2 capable and capable of shallow clones. The latter will initially be used, but we will likely experiment with more v2 features since it allows things such as skipping large objects/etc.
We previously had a handler for this in our codebase. The main differences to that implementation are:
- We don't proxy via the frontend, we now redirect directly to the responsible gitserver.
- We support protocol v2.
- We make gitserver responsible for all git service communication, rather than having business logic in the frontend internal handler.
Test Plan: unit and manually cloning via the dev server
git clone http://localhost:3090/.internal/git/github.com/gorilla/mux
Part of https://github.com/sourcegraph/sourcegraph/issues/6728