]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Handle empty file add in Git export
authorvrana <jakubv@fb.com>
Fri, 21 Sep 2012 17:23:04 +0000 (10:23 -0700)
committervrana <jakubv@fb.com>
Fri, 21 Sep 2012 18:22:21 +0000 (11:22 -0700)
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

index 4812b0ab36f216b3afac4009491fa613cd33b9a8..91ccb54163a5d2fadc0ec7adf52580c17939be30 100644 (file)
@@ -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";