Permalink
Browse files

Add missing newline in arc export

Summary:
Hunk may be missing newline at end of file. It produces exports like this:

  lang=diff
  --- a/third-party
  +++ b/third-party
  @@ -1 +1 @@
  -/mnt/gvfs/third-party/90cb1654197e56261b1733c704b387285f36208e
  \ No newline at end of file
  +/mnt/gvfs/third-party/7097083d10d37251218531da398545658872a47a
  \ No newline at end of filediff --git a/ti/proxygen/TARGETS b/ti/proxygen/TARGETS

Test Plan:
  $ arc export --git --diff 1

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, lesliepc16

Differential Revision: https://secure.phabricator.com/D3672
  • Loading branch information...
1 parent 35f2015 commit c57ee8e56433600253b717bc538efda77ec986c8 vrana committed Oct 10, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/parser/ArcanistBundle.php
@@ -600,6 +600,11 @@ private function buildHunkChanges(array $hunks) {
$result[] = "@@ -{$o_head} +{$n_head} @@".PHP_EOL;
$result[] = $corpus;
+
+ $last = substr($corpus, -1);
+ if ($last !== false && $last != "\r" && $last != "\n") {
+ $result[] = PHP_EOL;
+ }
}
}
return implode('', $result);

0 comments on commit c57ee8e

Please sign in to comment.