]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Image files should also be treated as binary files when patching.
authortuomaspelkonen <tuomaspelkonen@fb.com>
Wed, 25 May 2011 00:07:14 +0000 (17:07 -0700)
committertuomaspelkonen <tuomaspelkonen@fb.com>
Wed, 25 May 2011 01:12:53 +0000 (18:12 -0700)
Summary:
Arc patch for image files failed, because they were treated like text
files.

Test Plan:
Tested that 'arc patch' worked for a png file.

Reviewed By: jungejason
Reviewers: epriestley, jungejason
CC: aran, jungejason
Differential Revision: 341

src/parser/bundle/ArcanistBundle.php

index b4ca908cc3e55466040efd260d85f5a88579a98f..4f2dfad732d137847035af22e0ad9de0b860b2cc 100644 (file)
@@ -185,7 +185,8 @@ class ArcanistBundle {
       $old_mode = idx($change->getOldProperties(), 'unix:filemode', '100644');
       $new_mode = idx($change->getNewProperties(), 'unix:filemode', '100644');
 
-      $is_binary = ($file_type == ArcanistDiffChangeType::FILE_BINARY);
+      $is_binary = ($file_type == ArcanistDiffChangeType::FILE_BINARY ||
+                    $file_type == ArcanistDiffChangeType::FILE_IMAGE);
 
       if ($is_binary) {
         $change_body = $this->buildBinaryChange($change);