From bc1be958bdd27c5fcefc075c70f8b02df9eab78c Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 14 Apr 2011 14:16:53 -0700 Subject: [PATCH] Allow GitCommitChangeParser to parse 'T' (type change) messages in git history. --- .../PhabricatorRepositoryGitCommitChangeParserWorker.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/applications/repository/worker/commitchangeparser/git/PhabricatorRepositoryGitCommitChangeParserWorker.php b/src/applications/repository/worker/commitchangeparser/git/PhabricatorRepositoryGitCommitChangeParserWorker.php index c27f24b9c2..27ca9c6bbc 100644 --- a/src/applications/repository/worker/commitchangeparser/git/PhabricatorRepositoryGitCommitChangeParserWorker.php +++ b/src/applications/repository/worker/commitchangeparser/git/PhabricatorRepositoryGitCommitChangeParserWorker.php @@ -101,6 +101,10 @@ class PhabricatorRepositoryGitCommitChangeParserWorker $change_target = $src_path; $move_away[$change_target][] = $change_path; break; + case 'T': + // Type of the file changed, fall through and treat it as a + // modification. Not 100% sure this is the right thing to do but it + // seems reasonable. case 'M': if ($file_type == DifferentialChangeType::FILE_DIRECTORY) { $change_type = DifferentialChangeType::TYPE_CHILD; @@ -109,6 +113,8 @@ class PhabricatorRepositoryGitCommitChangeParserWorker $change_type = DifferentialChangeType::TYPE_CHANGE; } break; + // NOTE: "U" (unmerged) and "X" (unknown) statuses are also possible + // in theory but shouldn't appear here. default: throw new Exception("Failed to parse line '{$line}'."); }