On some special cases ArcanistDiffParser fails to parse filenames out of the patch.
Data
For example try feed following patch to diff parser:
diff --git diff_staging/solo_score_timeout.10f178f2a16f4143aedb48f9dfaba3fe.1489777879750.json diff_staging/solo_score_timeout.10f178f2a16f4143aedb48f9dfaba3fe.1489777879750.new.json index 9fd44d5..a3bdf2e 100644 --- diff_staging/solo_score_timeout.10f178f2a16f4143aedb48f9dfaba3fe.1489777879750.json +++ diff_staging/solo_score_timeout.10f178f2a16f4143aedb48f9dfaba3fe.1489777879750.new.json @@ -1,3 +1,3 @@ { - "reason": "arstarst", + "reason": "ienen", } \ No newline at end of file
JSON representation of the patch above:
"diff --git diff_staging\/solo_score_timeout.10f178f2a16f4143aedb48f9dfaba3fe.1489777879750.json diff_staging\/solo_score_timeout.10f178f2a16f4143aedb48f9dfaba3fe.1489777879750.new.json\r\nindex 9fd44d5..a3bdf2e 100644\r\n--- diff_staging\/solo_score_timeout.10f178f2a16f4143aedb48f9dfaba3fe.1489777879750.json\r\n+++ diff_staging\/solo_score_timeout.10f178f2a16f4143aedb48f9dfaba3fe.1489777879750.new.json\r\n@@ -1,3 +1,3 @@\r\n {\r\n- \"reason\": \"arstarst\", \r\n+ \"reason\": \"ienen\", \r\n }\r\n\\ No newline at end of file"
Reproduction steps
- Open https://secure.phabricator.com/conduit/method/differential.createrawdiff/ (ArcanistDiffParser is used in this API method)
- Fill JSON representation from above to the diff field.
- Submit the form.
Expected
Created a diff.
Received
An error: "#1048: Column 'filename' cannot be null"
Versions
This bug was introduced with rARCd0957c344156356123048be2219fb95a54c89a85 - every Phabricator instance with this version of Arcanist or newer has mentioned problem.
Reverting the file to previous version solves the problem.