summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosip Sokcevic <sokcevic@google.com>2023-11-20 10:31:53 -0800
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-11-20 19:22:53 +0000
commitc287428b37c485edeaefbbfb1b99ceb20cc303f6 (patch)
tree68778b718d30a854945379ccab7f5e46cf34ed8b
parentc984e8d4f6c63af9781b679efd7aa734ad36f47f (diff)
downloadgit-repo-c287428b37c485edeaefbbfb1b99ceb20cc303f6.tar.gz
info: Handle undefined mergeBranch
When a repo client is initialized with --standalone-manifest, it doesn't have merge branch defined. This results in mergeBranch being None. Bug: b/308025460 Change-Id: Iebceac0976e5d3adab5300bd8dfc76744a791234 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/393716 Tested-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
-rw-r--r--subcmds/info.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/subcmds/info.py b/subcmds/info.py
index f637600e..ab230ddd 100644
--- a/subcmds/info.py
+++ b/subcmds/info.py
@@ -97,7 +97,9 @@ class Info(PagedCommand):
97 self.headtext(self.manifest.default.revisionExpr) 97 self.headtext(self.manifest.default.revisionExpr)
98 self.out.nl() 98 self.out.nl()
99 self.heading("Manifest merge branch: ") 99 self.heading("Manifest merge branch: ")
100 self.headtext(mergeBranch) 100 # The manifest might not have a merge branch if it isn't in a git repo,
101 # e.g. if `repo init --standalone-manifest` is used.
102 self.headtext(mergeBranch or "")
101 self.out.nl() 103 self.out.nl()
102 self.heading("Manifest groups: ") 104 self.heading("Manifest groups: ")
103 self.headtext(manifestGroups) 105 self.headtext(manifestGroups)