]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Revert "accommodate git's diff.suppress-blank-empty=true setting (D3963)"
authorepriestley <git@epriestley.com>
Thu, 15 Nov 2012 23:47:43 +0000 (15:47 -0800)
committerepriestley <git@epriestley.com>
Thu, 15 Nov 2012 23:47:43 +0000 (15:47 -0800)
Summary: Reverts D3963, which is obsoleted by D3969.

Test Plan: Straight revert.

Reviewers: vrana, jiiix, btrahan

Reviewed By: vrana

CC: aran
Differential Revision: https://secure.phabricator.com/D3970

src/repository/api/ArcanistGitAPI.php

index 435c45e9d4b7a98e41407b3f9a8bf2b8e0c6c8d1..1158f896a1d60fb8a6fd5a319da741b0dfdd5b6d 100644 (file)
@@ -260,14 +260,8 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
     return $this->relativeCommit;
   }
 
-  private function getDiffFullCommand($detect_moves_and_renames = true) {
-    $diff_cmd = array(
-      // Our diff parser relies on the trailing spaces that are suppressed
-      // when the diff.suppress-blank-empty boolean is set to "true".
-      // Without the following, "arc lint" would always fail with this:
-      // "Diff Parse Exception: Found the wrong number of hunk lines."
-      '-c diff.suppress-blank-empty=false',
-      'diff',
+  private function getDiffFullOptions($detect_moves_and_renames = true) {
+    $options = array(
       self::getDiffBaseOptions(),
       '--no-color',
       '--src-prefix=a/',
@@ -276,11 +270,11 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
     );
 
     if ($detect_moves_and_renames) {
-      $diff_cmd[] = '-M';
-      $diff_cmd[] = '-C';
+      $options[] = '-M';
+      $options[] = '-C';
     }
 
-    return implode(' ', $diff_cmd);
+    return implode(' ', $options);
   }
 
   private function getDiffBaseOptions() {
@@ -298,9 +292,9 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
   }
 
   public function getFullGitDiff() {
-    $diff_cmd = $this->getDiffFullCommand();
+    $options = $this->getDiffFullOptions();
     list($stdout) = $this->execxLocal(
-      "{$diff_cmd} %s --",
+      "diff {$options} %s --",
       $this->getRelativeCommit());
     return $stdout;
   }
@@ -312,9 +306,9 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
    *               generate real diff text.
    */
   public function getRawDiffText($path, $detect_moves_and_renames = true) {
-    $diff_cmd = $this->getDiffFullCommand($detect_moves_and_renames);
+    $options = $this->getDiffFullOptions($detect_moves_and_renames);
     list($stdout) = $this->execxLocal(
-      "{$diff_cmd} %s -- %s",
+      "diff {$options} %s -- %s",
       $this->getRelativeCommit(),
       $path);
     return $stdout;