Commit 2e24812d authored by techtonik's avatar techtonik Committed by Commit bot

map-branches: Fix crash with --show-subject when branch name matches files

Traceback (most recent call last):
  ...
  File "...\\git_map_branches.py", line 303, in main
    mapper.start()
  File "...\\git_map_branches.py", line 169, in start
    self.__append_branch(root)
  File "...\\git_map_branches.py", line 272, in __append_branch
    self.__append_branch(child, depth=depth + 1)
  File "...\\git_map_branches.py", line 267, in __append_branch
    line.append(run('log', '-n1', '--format=%s', branch))
  File "...\git_common.py", line 599, in run
    return run_with_stderr(*cmd, **kwargs)[0]
  File "...\git_common.py", line 668, in run_with_stderr
    raise subprocess2.CalledProcessError(retcode, cmd, os.getcwd(), ret, err)
subprocess2.CalledProcessError: Command '...\\git.bat -c color.ui=never log -n1 --format=%s readme' returned non-zero exit status 128 in ...
fatal: ambiguous argument 'readme': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

BUG=

Review-Url: https://codereview.chromium.org/2153803002
parent 263e9287
...@@ -270,7 +270,7 @@ class BranchMapper(object): ...@@ -270,7 +270,7 @@ class BranchMapper(object):
# The subject of the most recent commit on the branch. # The subject of the most recent commit on the branch.
if self.show_subject: if self.show_subject:
line.append(run('log', '-n1', '--format=%s', branch)) line.append(run('log', '-n1', '--format=%s', branch, '--'))
self.output.append(line) self.output.append(line)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment