]> khamidou — GitHub mirrors - arcanist.git/commit
Fix an issue with unified patch generation for terminal newline changes
authorepriestley <git@epriestley.com>
Fri, 16 Mar 2012 20:40:11 +0000 (13:40 -0700)
committerepriestley <git@epriestley.com>
Fri, 16 Mar 2012 20:40:11 +0000 (13:40 -0700)
commitf15479c832d836424a070bfee7263548882ef785
treebedf5dfe687940b461367fe990b1cb47a9ad2cc5
parentdc6816789a31e9eb4e2f83c8750a0e1eea2cf865
Fix an issue with unified patch generation for terminal newline changes

Summary:
We currently detect the "\" as a change, and may generate a hunk like this, without changes.

  @@ -97,4 +98,4 @@
   mmm
   mmm
   mmm
  \ No newline at end of file

While "git apply" is OK with this, "patch" is not. Instead, don't detect this as a change (it is always accompanied by - / + if it's a real change).

Test Plan: Successfully applied a previously-failing SVN patch to a file without a terminal newline that had nonlocal changes.

Reviewers: 20after4, nh, btrahan

Reviewed By: 20after4

CC: aran, epriestley
Differential Revision: https://secure.phabricator.com/D1934
src/parser/bundle/ArcanistBundle.php
src/parser/bundle/__tests__/ArcanistBundleTestCase.php
src/parser/bundle/__tests__/data/trailing-newline.diff [new file with mode: 0644]
src/parser/bundle/__tests__/data/trailing-newline.new [new file with mode: 0644]
src/parser/bundle/__tests__/data/trailing-newline.old [new file with mode: 0644]