mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
git-map-branches: support no-parent when showing subjects
If one of the "branches" being shown by 'git map-branches' is
the pseudo-branch "{NO_UPSTREAM}", and the user has asked the
command to print the subject line of each branch, it would
crash. This change causes it to gracefully handle that case.
R=lgarron@chromium.org
Bug: 758428
Change-Id: Id0ff1c6fd90b5efbb07e118ae088e3999c234b67
Reviewed-on: https://chromium-review.googlesource.com/639190
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
This commit is contained in:
@@ -269,7 +269,10 @@ class BranchMapper(object):
|
||||
|
||||
# The subject of the most recent commit on the branch.
|
||||
if self.show_subject:
|
||||
line.append(run('log', '-n1', '--format=%s', branch, '--'))
|
||||
if branch:
|
||||
line.append(run('log', '-n1', '--format=%s', branch, '--'))
|
||||
else:
|
||||
line.append('')
|
||||
|
||||
self.output.append(line)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user