]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
buildman: Allow branch names which conflict with directories
authorSimon Glass <sjg@chromium.org>
Sun, 13 Mar 2016 01:50:31 +0000 (18:50 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 18 Mar 2016 03:27:39 +0000 (21:27 -0600)
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>
tools/buildman/func_test.py
tools/patman/gitutil.py

index 75eb3a97bbee72565951843be91151dc32d43689..a0bd46cbfbed046726d9c37f69cb189d833c8d1d 100644 (file)
@@ -255,6 +255,8 @@ class TestFunctional(unittest.TestCase):
         self.assertEqual(gitutil.use_no_decorate, True)
 
     def _HandleCommandGitLog(self, args):
+        if args[-1] == '--':
+            args = args[:-1]
         if '-n0' in args:
             return command.CommandResult(return_code=0)
         elif args[-1] == 'upstream/master..%s' % self._test_branch:
index 5f1b4f6e7641065766dbbe4d22b8c96ffaa8feca..e088baeb819e3895bcec5277e1f011d493904fbd 100644 (file)
@@ -44,6 +44,11 @@ def LogCmd(commit_range, git_dir=None, oneline=False, reverse=False,
         cmd.append('-n%d' % count)
     if commit_range:
         cmd.append(commit_range)
+
+    # Add this in case we have a branch with the same name as a directory.
+    # This avoids messages like this, for example:
+    #   fatal: ambiguous argument 'test': both revision and filename
+    cmd.append('--')
     return cmd
 
 def CountCommitsToBranch():