3959: Bogus "file was not found" error when moving files and changing their mode in a Git repository

vzei****@gmai***** (Google Code) (Is this you? Claim this profile.)
Using RBTools 0.7.4 under Cygwin from a git repository on a branch containing a single commit compared to origin/master results in the following:

% rbt post --debug
>>> RBTools 0.7.4
>>> Python 2.7.3 (default, Dec 18 2012, 13:50:09)
[GCC 4.5.3]
>>> Running on CYGWIN_NT-6.1-WOW64-1.7.16-0.262-5-3-i686-32bit
>>> Running: git -c core.quotepath=false -c diff.noprefix=false diff --no-color --full-index --ignore-submodules -M --no-ext-diff 09fba2163dbe7787c3a152f933f218478531f354..fd634bf805d95da92214fa060b465865f88d6731
>>> Making HTTP GET request to http://rbserver/review/api/review-requests/124/?only-links=diffs%2Cdraft&only-fields=absolute_url%2Cbugs_closed%2Cid%2Cstatus
>>> Making HTTP GET request to http://rbserver/review/api/review-requests/124/diffs/?only-fields=
>>> Making HTTP POST request to http://rbserver/review/api/review-requests/124/diffs/
>>> Got API Error 207 (HTTP code 400): The file was not found in the repository.
>>> Error data: {u'stat': u'fail', u'file': u'SWIG/swig.exe', u'err': {u'msg': u'The file was not found in the repository.', u'code': 207}, u'revision': u''}
Traceback (most recent call last):
  File "/usr/bin/rbt", line 9, in <module>
    load_entry_point('RBTools==0.7.4', 'console_scripts', 'rbt')()
  File "/usr/lib/python2.7/site-packages/rbtools/commands/main.py", line 133, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/usr/lib/python2.7/site-packages/rbtools/commands/__init__.py", line 612, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/usr/lib/python2.7/site-packages/rbtools/commands/post.py", line 754, in main
    (msg_prefix, e))
rbtools.commands.CommandError: Error validating diff

SWIG/swig.exe: The file was not found in the repository. (HTTP 400, API Error 207)

Doing "rbt diff" works just fine but running "rbt post --diff-filename" fails with the same error. The relevant part of the diff is:

diff --git a/SWIG/swig.exe b/3rdparty/swig/swig.exe
old mode 100644
new mode 100755
similarity index 100%
rename from SWIG/swig.exe
rename to 3rdparty/swig/swig.exe

As you can see, the file was renamed and its mode changed. Removing the "old mode" and "new mode" lines from the diff allows the review to go through, so apparently there is a problem with handling renames combined with mode changes.
#1 david
  • -reviewboard
#2 david
  • +BetterErrors