summaryrefslogtreecommitdiffstats
path: root/subcmds/upload.py
diff options
context:
space:
mode:
authorjoehsu <joehsu@google.com>2024-10-02 20:01:59 +0800
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-10-28 23:47:08 +0000
commitf9f4df62e062cccd279867c551a109365b4f380f (patch)
treef9bc79c452904a7b4de9b408ac15b6e9a4e68f0d /subcmds/upload.py
parentebdf0409d289b1133d5d95c8e06c30709902f1f0 (diff)
downloadgit-repo-f9f4df62e062cccd279867c551a109365b4f380f.tar.gz
Use full name of the revision when checking dest-branchv2.49
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 <sokcevic@google.com> Tested-by: Joe Hsu <joehsu@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r--subcmds/upload.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py
index 6344ee31..9b77b0ee 100644
--- a/subcmds/upload.py
+++ b/subcmds/upload.py
@@ -603,19 +603,22 @@ Gerrit Code Review: https://www.gerritcodereview.com/
603 full_dest = destination 603 full_dest = destination
604 if not full_dest.startswith(R_HEADS): 604 if not full_dest.startswith(R_HEADS):
605 full_dest = R_HEADS + full_dest 605 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
606 609
607 # If the merge branch of the local branch is different from 610 # If the merge branch of the local branch is different from
608 # the project's revision AND destination, this might not be 611 # the project's revision AND destination, this might not be
609 # intentional. 612 # intentional.
610 if ( 613 if (
611 merge_branch 614 merge_branch
612 and merge_branch != branch.project.revisionExpr 615 and merge_branch != full_revision
613 and merge_branch != full_dest 616 and merge_branch != full_dest
614 ): 617 ):
615 print( 618 print(
616 f"For local branch {branch.name}: merge branch " 619 f"For local branch {branch.name}: merge branch "
617 f"{merge_branch} does not match destination branch " 620 f"{merge_branch} does not match destination branch "
618 f"{destination}" 621 f"{destination} and revision {branch.project.revisionExpr}"
619 ) 622 )
620 print("skipping upload.") 623 print("skipping upload.")
621 print( 624 print(