upload: fix FileNotFoundError when no superproject
Upload gets a FileNotFoundError if not using superproject because it tries to access the superproject's repo_id before checking if superproject was actually enabled. Reorder the logic to check use_superproject first. Change-Id: I65cd2adab481e799dd7bb75e1a83553ad6e34d8d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/484401 Tested-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
parent
85352825ff
commit
f91f4462e6
1 changed files with 6 additions and 3 deletions
|
@ -627,9 +627,12 @@ Gerrit Code Review: https://www.gerritcodereview.com/
|
||||||
# If using superproject, add the root repo as a push option.
|
# If using superproject, add the root repo as a push option.
|
||||||
manifest = branch.project.manifest
|
manifest = branch.project.manifest
|
||||||
push_options = list(opt.push_options)
|
push_options = list(opt.push_options)
|
||||||
sp = manifest.superproject
|
if manifest.manifestProject.use_superproject:
|
||||||
if sp and sp.repo_id and manifest.manifestProject.use_superproject:
|
sp = manifest.superproject
|
||||||
push_options.append(f"custom-keyed-value=rootRepo:{sp.repo_id}")
|
if sp:
|
||||||
|
r_id = sp.repo_id
|
||||||
|
if r_id:
|
||||||
|
push_options.append(f"custom-keyed-value=rootRepo:{r_id}")
|
||||||
|
|
||||||
branch.UploadForReview(
|
branch.UploadForReview(
|
||||||
people,
|
people,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue