mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 21:02:41 +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:
parent
c8ee8d8ae9
commit
8ea9935ea5
1 changed files with 6 additions and 1 deletions
|
@ -29,7 +29,12 @@ final class PhabricatorGitGraphStream
|
||||||
if (!isset($this->parents[$commit])) {
|
if (!isset($this->parents[$commit])) {
|
||||||
$this->parseUntil($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) {
|
public function getCommitDate($commit) {
|
||||||
|
|
Loading…
Reference in a new issue