From 2e24812dd3b5af712851e5ebd79ee65a1ab120e5 Mon Sep 17 00:00:00 2001 From: techtonik Date: Tue, 19 Jul 2016 10:39:42 -0700 Subject: [PATCH] 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 [...] -- [...]' BUG= Review-Url: https://codereview.chromium.org/2153803002 --- git_map_branches.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git_map_branches.py b/git_map_branches.py index c00dcb95e..b889b454d 100755 --- a/git_map_branches.py +++ b/git_map_branches.py @@ -270,7 +270,7 @@ 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)) + line.append(run('log', '-n1', '--format=%s', branch, '--')) self.output.append(line)