From 7119f0c4cc9af95a44b81fde1763a212df7ba2a2 Mon Sep 17 00:00:00 2001 From: vrana Date: Tue, 18 Sep 2012 15:07:01 -0700 Subject: [PATCH] Mark moved binary file as image 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index 441b0f74..f2aab999 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -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); } } -- 2.43.0