diff --git a/src/workflow/diff/ArcanistDiffWorkflow.php b/src/workflow/diff/ArcanistDiffWorkflow.php index 3e602793..3db0f813 100644 --- a/src/workflow/diff/ArcanistDiffWorkflow.php +++ b/src/workflow/diff/ArcanistDiffWorkflow.php @@ -898,11 +898,9 @@ EOTEXT return $result; } - $future = new ExecFuture('file -b --mime -'); - $future->write($data); - list($mime_type) = $future->resolvex(); - - $mime_type = trim($mime_type); + $tmp = new TempFile(); + Filesystem::writeFile($tmp, $data); + $mime_type = Filesystem::getMimeType($tmp); $result['mime'] = $mime_type; echo "Uploading {$desc} '{$name}' ({$mime_type}, {$size} bytes)...\n"; diff --git a/src/workflow/diff/__init__.php b/src/workflow/diff/__init__.php index db89e37a..ec97b758 100644 --- a/src/workflow/diff/__init__.php +++ b/src/workflow/diff/__init__.php @@ -23,6 +23,7 @@ phutil_require_module('phutil', 'console'); phutil_require_module('phutil', 'console/editor'); phutil_require_module('phutil', 'filesystem'); phutil_require_module('phutil', 'filesystem/filelist'); +phutil_require_module('phutil', 'filesystem/tempfile'); phutil_require_module('phutil', 'future/exec'); phutil_require_module('phutil', 'utils');