From 22c51d0d71bc7e79accbb4ebe7a5bb4a8991a510 Mon Sep 17 00:00:00 2001 From: vrana Date: Fri, 21 Sep 2012 10:23:04 -0700 Subject: [PATCH] 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 --- src/parser/ArcanistBundle.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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"; -- 2.43.0