1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 12:52:42 +01:00

Deduplicate parents from PhabricatorGitGraphStream

Summary: Fixes T5226. It's rare (but possible) for a commit to have the same parent more than once in Git.

Test Plan: Ran `bin/repository parents` on a normal repository.

Reviewers: joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Maniphest Tasks: T5226

Differential Revision: https://secure.phabricator.com/D9344
This commit is contained in:
epriestley 2014-06-02 15:25:28 -07:00
parent c8ee8d8ae9
commit 8ea9935ea5

View file

@ -29,7 +29,12 @@ final class PhabricatorGitGraphStream
if (!isset($this->parents[$commit])) {
$this->parseUntil($commit);
}
return $this->parents[$commit];
$parents = $this->parents[$commit];
// NOTE: In Git, it is possible for a commit to list the same parent more
// than once. See T5226. Discard duplicate parents.
return array_unique($parents);
}
public function getCommitDate($commit) {