]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Mark moved binary file as image
authorvrana <jakubv@fb.com>
Tue, 18 Sep 2012 22:07:01 +0000 (15:07 -0700)
committervrana <jakubv@fb.com>
Thu, 20 Sep 2012 20:19:24 +0000 (13:19 -0700)
Test Plan: Moved image, verified that the source file is marked as image: https://secure.phabricator.com/differential/diff/6924/

Reviewers: epriestley, btrahan

Reviewed By: btrahan

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D3520

src/workflow/ArcanistDiffWorkflow.php

index 441b0f741ea0268c206a3f08442c13a6f94968d5..f2aab999e76495dd8530f64acc134e6775887b69 100644 (file)
@@ -1028,7 +1028,8 @@ EOTEXT
       $change->setMetadata('new:file:size',      $new_dict['size']);
       $change->setMetadata('new:file:mime-type', $new_dict['mime']);
 
-      if (preg_match('@^image/@', $new_dict['mime'])) {
+      $mime_type = coalesce($new_dict['mime'], $old_dict['mime']);
+      if (preg_match('@^image/@', $mime_type)) {
         $change->setFileType(ArcanistDiffChangeType::FILE_IMAGE);
       }
     }