Skip to content

Commit

Permalink
info: Handle undefined mergeBranch
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Mike Frysinger <[email protected]>
Commit-Queue: Josip Sokcevic <[email protected]>
  • Loading branch information
sokcevicG authored and LUCI committed Nov 20, 2023
1 parent c984e8d commit c287428
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion subcmds/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ def Execute(self, opt, args):
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)
Expand Down

0 comments on commit c287428

Please sign in to comment.