4133: git-svn integration doesn't work for new files

VZ

What version are you running?

0.7.5

What steps will reproduce the problem?

  1. Use a git-svn repository.
  2. Create a new file and make a commit with it.
  3. Run rbt post or just rbt diff.

What is the expected output? What do you see instead?

No error is expected, but an error occurs.

What operating system are you using?

Debian Wheezy.

Attach the debug out from the command.

% rbt diff --debug
>>> RBTools 0.7.5
>>> Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2]
>>> Running on Linux-3.2.0-4-amd64-x86_64-with-debian-7.9
[...]
>>> Checking for a Subversion repository...
>>> Running: svn --non-interactive info
>>> Command exited with rc 1: ['svn', '--non-interactive', u'info']
svn: '.' is not a working copy
---
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Running: git config core.bare
>>> Running: git rev-parse --show-toplevel
>>> Running: git symbolic-ref -q HEAD
>>> Running: git svn info
>>> Running: git svn rebase -n
>>> repository info: Path: svn+ssh://xxx, Base path: /trunk, Supports changesets: False
>>> Running: git config --get reviewboard.url
>>> Making HTTP GET request to http://xxx/review/api/
>>> Running: git rev-parse refs/heads/review
>>> Running: git merge-base aaaaaa refs/remotes/origin/trunk
>>> Running: git rev-parse bbbbbb
>>> Running: git status --porcelain --untracked-files=no
>>> Running: git rev-parse --git-dir
>>> Running: git version
>>> Running: git -c core.quotepath=false diff-tree --no-color --no-prefix -r -u --no-ext-diff bbbbbb..aaaaaa
>>> Running: git rev-parse --git-dir
>>> Running: git -c core.quotepath=false diff --no-color --no-prefix -r -u --no-ext-diff bbbbbb..aaaaaa -- NewFile
>>> Running: git -c core.quotepath=false diff --no-color --no-prefix -r -u --no-ext-diff bbbbbb..aaaaaa -- 100644
>>> Running: git -c core.quotepath=false diff --no-color --no-prefix -r -u --no-ext-diff bbbbbb..aaaaaa -- 0000000..0a8c4fb
>>> Running: git -c core.quotepath=false diff --no-color --no-prefix -r -u --no-ext-diff bbbbbb..aaaaaa -- /dev/null
>>> Command exited with rc 128: ['git', '-c', 'core.quotepath=false', 'diff', '--no-color', '--no-prefix', '-r', '-u', '--no-ext-diff', u'bbbbbb..aaaaaa', '--', u'/dev/null']
ERROR: Could not get diff for all files (git-diff failed for "/dev/null"). Refusing to return a partial diff.
>>> Running: git svn find-rev bbbbbb
Traceback (most recent call last):
  File "/.../rbt", line 9, in <module>
    load_entry_point('RBTools==0.7.5', 'console_scripts', 'rbt')()
  File "/.../RBTools-0.7.5-py2.7.egg/rbtools/commands/main.py", line 133, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/.../RBTools-0.7.5-py2.7.egg/rbtools/commands/__init__.py", line 622, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/.../RBTools-0.7.5-py2.7.egg/rbtools/commands/diff.py", line 68, in main
    extra_args=extra_args)
  File "/.../RBTools-0.7.5-py2.7.egg/rbtools/clients/git.py", line 473, in diff
    exclude_patterns)
  File "/.../RBTools-0.7.5-py2.7.egg/rbtools/clients/git.py", line 588, in make_diff
    return self.make_svn_diff(merge_base, diff_lines)
  File "/.../RBTools-0.7.5-py2.7.egg/rbtools/clients/git.py", line 610, in make_svn_diff
    for i, line in enumerate(diff_lines):
TypeError: 'NoneType' object is not iterable

Please provide any additional information below.

It clearly misparses the diff which looks like

diff --git NewFile NewFile
new file mode 100644
index 0000000..ccccccc
--- /dev/null
+++ NewFile
@@ -0,0 +1,20 @@
...

but I have no idea why (nor even why does it need to parse the diff at all
instead of just using git diff --name-only in the first place...).