]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Update documentation for changed splitGitDiffPaths function
authorAlex Vandiver <alexmv@dropbox.com>
Fri, 19 Aug 2016 21:23:15 +0000 (14:23 -0700)
committerAlex Vandiver <alexmv@dropbox.com>
Fri, 19 Aug 2016 21:55:33 +0000 (14:55 -0700)
Summary:
The behavior (and name) of this function was changed in
D16405, but the documentation was not updated to reflect the new
contract.

Test Plan: Untested; pure doc changes.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16425

src/parser/ArcanistDiffParser.php

index a310fb41470852e7f0977c2271b9dca1c838d50c..1d21384680cde0d8f0caa7b2f94a74d2c87ffcc0 100644 (file)
@@ -1310,11 +1310,17 @@ final class ArcanistDiffParser extends Phobject {
 
 
   /**
-   * Split the paths on a "diff --git" line into old and new paths. This
-   * is difficult because they may be ambiguous if the files contain spaces.
+   * Extracts the common filename from two strings with differing path
+   * prefixes as found after `diff --git`.  These strings may be
+   * quoted; if so, the filename is returned unescaped.  The prefixes
+   * default to "a/" and "b/", but may be any string -- or may be
+   * entierly absent.  This function may return "null" if the hunk
+   * represents a file move or copy, and with pathological renames may
+   * return an incorrect value.  Such cases are expected to be
+   * recovered by later rename detection codepaths.
    *
    * @param string Text from a diff line after "diff --git ".
-   * @return pair<string, string> Old and new paths.
+   * @return string Filename being altered, or null for a rename.
    */
   public static function extractGitCommonFilename($paths) {
     $matches = null;