Use remote_url instead of remote for download
If usepushurl is set, then it's likely that the pushurl is pointing to the code review system while the normal url is pointing to a read only mirror. If the read-only mirror in question doesn't contain the gerrit refs (like opendev.org currently) then git fetch origin won't work properly. However, we already calculate the correct URL at the top of the function for use in query_reviews, and fetch will happily work with a full url rather than a named remote. Update the function to use the remote_url so that usepushurl works even if the mirror url does not contain refs/changes. Change-Id: Ib72afe97e65cb1dcaf95e28450dfe6e7d5f88965
This commit is contained in:
parent
9b68a44f38
commit
853f3bffb3
@ -1195,7 +1195,7 @@ def fetch_review(review, masterbranch, remote, project):
|
|||||||
|
|
||||||
print("Downloading %s from gerrit" % refspec)
|
print("Downloading %s from gerrit" % refspec)
|
||||||
run_command_exc(PatchSetGitFetchFailed,
|
run_command_exc(PatchSetGitFetchFailed,
|
||||||
"git", "fetch", remote, refspec)
|
"git", "fetch", remote_url, refspec)
|
||||||
return branch_name, remote_branch
|
return branch_name, remote_branch
|
||||||
|
|
||||||
|
|
||||||
|
5
releasenotes/notes/fix-usepushurl-c4a234689d808ece.yaml
Normal file
5
releasenotes/notes/fix-usepushurl-c4a234689d808ece.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fixed ``usepushurl`` to work when a read-only mirror being used as
|
||||||
|
``origin`` does not contain ``refs/changes`` from gerrit.
|
Loading…
Reference in New Issue
Block a user