From d991d640f07c8610ccd6c3501a53578afee70f97 Mon Sep 17 00:00:00 2001
From: Colan Schwartz <colan@58704.no-reply.drupal.org>
Date: Wed, 24 Feb 2016 12:20:42 -0500
Subject: [PATCH] Issue #2674924 by colan: Upgrade Drush commands for Drupal 8.

---
 hacked.drush.inc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/hacked.drush.inc b/hacked.drush.inc
index 640127b..81dd3ac 100644
--- a/hacked.drush.inc
+++ b/hacked.drush.inc
@@ -262,7 +262,7 @@ function drush_hacked_drush_command_validate($short_name = '') {
     return drush_set_error('HACKED_PROJECT_NOT_FOUND', dt('A valid project must be specified', array('@project' => $short_name)));
   }
 
-  $project = hacked_project_load($short_name);
+  $project = new Drupal\hacked\hackedProject($short_name);
   $project->identify_project();
   if (!$project->project_identified) {
     return drush_set_error('HACKED_PROJECT_NOT_FOUND', dt('Could not find project: @project', array('@project' => $short_name)));
@@ -277,7 +277,7 @@ function drush_hacked_drush_command_validate($short_name = '') {
  * otherwise just the changed and deleted files are shown.
  */
 function drush_hacked_details($short_name) {
-  $project = hacked_project_load($short_name);
+  $project = new Drupal\hacked\hackedProject($short_name);
   $report = $project->compute_details();
 
   drush_print(dt('Details for project: @name', array('@name' => $project->title())));
@@ -345,13 +345,15 @@ function drush_hacked_diff_validate($short_name = '') {
  * otherwise just the changed and deleted files are shown.
  */
 function drush_hacked_diff($short_name) {
-  $project = hacked_project_load($short_name);
+  $project = new Drupal\hacked\hackedProject($short_name);
 
   $local_location = $project->file_get_location('local', '');
   $clean_location = $project->file_get_location('remote', '');
 
   // If the hasher is our ignore line endings one, then ignore line endings.
-  if (variable_get('hacked_selected_file_hasher', HACKED_DEFAULT_FILE_HASHER) == 'hacked_ignore_line_endings') {
+  $hasher = \Drupal::config('hacked.settings')->get('selected_file_hasher');
+  $hasher = is_null($hasher) ? HACKED_DEFAULT_FILE_HASHER : $hasher;
+  if ($hasher == 'hacked_ignore_line_endings') {
     $default_options = '-uprb';
   }
   else {
-- 
2.5.0

