-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update mirror repo remote url before each fetch #32
Comments
I don't know whether I understood you correctly, but I guess you want to use one mirror regardless of the actual URL. For example, an initial clone from I think that can be solved by "normalizing" the URL further, reducing it to "/" and use that part as the index in the database. The interesting part will then be the update of the mirror, as currently that will use the URL initially stored in the bare git repo. This will have to change to use either the URL specified by a |
You've understood it correctly.
I've looked up how Jenkins does its native checkout (it doesn't do any node-based caching, but it does re-use the workspace if it already exists, so it is very similar thing) and it does exactly that - always explicitly updates the remote fetch url in the existing local repo with the one currently specified in the clone configuration. As for gitcache scenario, the "current repo original remote url" is only available during clone operation, and not for pull/fetch operations. |
The remote url of the same repository may slightly differ between gitcache invocations.
The use case: two different CI jobs running on the same machine (not even concurently, or anythign like that), but configured differently.
One is using the form of
https://${GITHUB_PAT}@github.com/<repo>.git
and the second one is usinggit@github.com:<repo>.git
with ssh-agent setup running.Because the remote url of the mirror repo is not updated, only the job who initially configured a mirror would work, and the other one would fail, since for instance having an ssh-agent for
https://
url is useless, and the PAT token for ssh url is unusable as well.The text was updated successfully, but these errors were encountered: