mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-26 20:17:52 +00:00
upload: Add superproject identifier as push option
When uploading, add the root superproject repo as a push option in the format `-o custom-keyed-value=rootRepo:$HOST/$PROJECT`. Bug: b/401147338 Change-Id: I00230256eb7ae307b03840bb4090c28dc8a0505e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/472601 Reviewed-by: Josip Sokcevic <sokcevic@chromium.org> Tested-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
This commit is contained in:
@ -628,6 +628,13 @@ Gerrit Code Review: https://www.gerritcodereview.com/
|
||||
branch.uploaded = False
|
||||
return
|
||||
|
||||
# If using superproject, add the root repo as a push option.
|
||||
manifest = branch.project.manifest
|
||||
push_options = list(opt.push_options)
|
||||
sp = manifest.superproject
|
||||
if sp and sp.repo_id and manifest.manifestProject.use_superproject:
|
||||
push_options.append(f"custom-keyed-value=rootRepo:{sp.repo_id}")
|
||||
|
||||
branch.UploadForReview(
|
||||
people,
|
||||
dryrun=opt.dryrun,
|
||||
@ -640,7 +647,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/
|
||||
ready=opt.ready,
|
||||
dest_branch=destination,
|
||||
validate_certs=opt.validate_certs,
|
||||
push_options=opt.push_options,
|
||||
push_options=push_options,
|
||||
patchset_description=opt.patchset_description,
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user