Revisión | d4c8572b7187cc21ca39d185fd19813e69fbd515 (tree) |
---|---|
Tiempo | 2016-03-18 12:27:39 |
Autor | Simon Glass <sjg@chro...> |
Commiter | Simon Glass |
buildman: Allow branch names which conflict with directories
At present if you try to use buildman with the branch 'test' it will
complain that it is unsure whether you mean the branch or the directory.
This is a feature of the 'git log' command that buildman uses. Fix it
by resolving the ambiguity.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
@@ -255,6 +255,8 @@ class TestFunctional(unittest.TestCase): | ||
255 | 255 | self.assertEqual(gitutil.use_no_decorate, True) |
256 | 256 | |
257 | 257 | def _HandleCommandGitLog(self, args): |
258 | + if args[-1] == '--': | |
259 | + args = args[:-1] | |
258 | 260 | if '-n0' in args: |
259 | 261 | return command.CommandResult(return_code=0) |
260 | 262 | elif args[-1] == 'upstream/master..%s' % self._test_branch: |
@@ -44,6 +44,11 @@ def LogCmd(commit_range, git_dir=None, oneline=False, reverse=False, | ||
44 | 44 | cmd.append('-n%d' % count) |
45 | 45 | if commit_range: |
46 | 46 | cmd.append(commit_range) |
47 | + | |
48 | + # Add this in case we have a branch with the same name as a directory. | |
49 | + # This avoids messages like this, for example: | |
50 | + # fatal: ambiguous argument 'test': both revision and filename | |
51 | + cmd.append('--') | |
47 | 52 | return cmd |
48 | 53 | |
49 | 54 | def CountCommitsToBranch(): |