From: vrana Date: Fri, 21 Sep 2012 17:23:04 +0000 (-0700) Subject: Handle empty file add in Git export X-Git-Tag: conduit-6~113 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=22c51d0d71bc7e79accbb4ebe7a5bb4a8991a510;p=arcanist.git Handle empty file add in Git export Summary: Fixes T1555. Test Plan: Added empty file, diffed it, exported and patched. Also manually created diff in Differential. Reviewers: btrahan, epriestley Reviewed By: btrahan CC: aran, Korvin Maniphest Tasks: T1555 Differential Revision: https://secure.phabricator.com/D3536 --- diff --git a/src/parser/ArcanistBundle.php b/src/parser/ArcanistBundle.php index 4812b0ab..91ccb541 100644 --- a/src/parser/ArcanistBundle.php +++ b/src/parser/ArcanistBundle.php @@ -412,11 +412,13 @@ final class ArcanistBundle { } } - if (!$is_binary) { - $result[] = "--- {$old_target}"; - $result[] = "+++ {$cur_target}"; + if ($change_body) { + if (!$is_binary) { + $result[] = "--- {$old_target}"; + $result[] = "+++ {$cur_target}"; + } + $result[] = $change_body; } - $result[] = $change_body; } $diff = implode("\n", $result)."\n";