Repository shows up as empty when "disableAutoGitUpdates" is true
Created by: beyang
Repro steps:
• Set "disableGitAutoUpdates": true
• Add Gitolite external service w/ some repositories
• Visit repo on Sourcegraph, observe "Empty repository"
• Go to repo settings mirroring page, observe an error. (After merging https://github.com/sourcegraph/sourcegraph/pull/3334, you'll see the error below. Before merging that, the error you see is a JSON unmarshalling error.)
I can fix the issue by setting "disableGitAutoUpdates": false
The specific error message is the error gitserver returns, because the repo directory does not yet exist. (It's trying to cd into that directory to find the clone URL, but it doesn't exist.) In theory, gitserver would kick off a git clone
in that scenario, but it doesn't appear to.
Investigation
- This is the method that generates the error shown in the UI. It errors because it attempts to compute the repo remote URL by cd'ing into a directory (the gitserver directory for the repo) that doesn't exist.
-
This enqueue-repo-update handler is invoked to kick off a clone on gitserver. It never fires when
disableAutoGitUpdates
is true. -
This is a code path that hits
enqueue-repo-update
regardless, but it only activates when the repo already exists in gitserver. It's possible that this should fire regardless of whether the repo has already been cloned.