From c287428b37c485edeaefbbfb1b99ceb20cc303f6 Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Mon, 20 Nov 2023 10:31:53 -0800 Subject: [PATCH] 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 Reviewed-by: Mike Frysinger Commit-Queue: Josip Sokcevic --- subcmds/info.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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): self.headtext(self.manifest.default.revisionExpr) self.out.nl() self.heading("Manifest merge branch: ") - self.headtext(mergeBranch) + # The manifest might not have a merge branch if it isn't in a git repo, + # e.g. if `repo init --standalone-manifest` is used. + self.headtext(mergeBranch or "") self.out.nl() self.heading("Manifest groups: ") self.headtext(manifestGroups)