]> git.ipfire.org Git - thirdparty/patchwork.git/commit
parser: recognise git commit consisting only of empty new file
authorDaniel Axtens <dja@axtens.net>
Thu, 28 Feb 2019 04:29:53 +0000 (15:29 +1100)
committerStephen Finucane <stephen@that.guru>
Sat, 2 Mar 2019 15:41:29 +0000 (15:41 +0000)
commit0c60d688d0ac3cf41477970b9c8d299ef1d4227b
treef7868a7fdc3d9cbacd9e9dcf058bdfdc877d375d
parentb00cb3cb8a675ca846d3439c45fae0df53ec342d
parser: recognise git commit consisting only of empty new file

Commits with only an empty new file are liable to be missed.
The parser state machine doesn't recognise the headers "new
file mode" and "index": teach it about them.

Add a test to demonstrate.

It's a little bit academic as you don't usually send patches like
that but sometimes you do, especially if you're a snowpatch dev :)

Closes: #256
Reported-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
(cherry picked from commit 9dd0b5ba843ccac5cf768a1c34226abe8b85cf6d)
patchwork/parser.py
patchwork/tests/mail/0021-git-empty-new-file.mbox [new file with mode: 0644]
patchwork/tests/test_parser.py