Skip to content

Commit f9f4df6

Browse files
joehsuLUCI
authored andcommitted
Use full name of the revision when checking dest-branch
The manifest usually doesn't sepecify the revision with the full name (e.g. refs/heads/REV). However, when checking if the name of the merge branch, full name is used on the merge branch. The CL use full name of revision when comparing it with the merge branch. Bug: b/370919047 Test: repo upload on a project with `dest-branch` set Change-Id: Ib6fa2f7246beb5bae0a26a70048a7ac03b6c5a2f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/438401 Reviewed-by: Josip Sokcevic <[email protected]> Tested-by: Joe Hsu <[email protected]> Commit-Queue: Josip Sokcevic <[email protected]>
1 parent ebdf040 commit f9f4df6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

subcmds/upload.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,19 +603,22 @@ def _ExpandCommaList(value):
603603
full_dest = destination
604604
if not full_dest.startswith(R_HEADS):
605605
full_dest = R_HEADS + full_dest
606+
full_revision = branch.project.revisionExpr
607+
if not full_revision.startswith(R_HEADS):
608+
full_revision = R_HEADS + full_revision
606609

607610
# If the merge branch of the local branch is different from
608611
# the project's revision AND destination, this might not be
609612
# intentional.
610613
if (
611614
merge_branch
612-
and merge_branch != branch.project.revisionExpr
615+
and merge_branch != full_revision
613616
and merge_branch != full_dest
614617
):
615618
print(
616619
f"For local branch {branch.name}: merge branch "
617620
f"{merge_branch} does not match destination branch "
618-
f"{destination}"
621+
f"{destination} and revision {branch.project.revisionExpr}"
619622
)
620623
print("skipping upload.")
621624
print(

0 commit comments

Comments
 (0)