1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-20 11:41:08 +01:00

Fix an issue with non-bare Git repositories and non-master branches

Summary: This is a little funky but fixes an issue with Git repos that are
non-bare needing "origin/" to resolve branches other than "master". Eventually
this should get cleaned up.

Test Plan: Reporting user verified this fixed their issue.

Auditors: btrahan
This commit is contained in:
epriestley 2013-11-05 15:09:08 -08:00
parent d5f41ef70e
commit ebcd60eae5
2 changed files with 11 additions and 3 deletions

View file

@ -32,11 +32,15 @@ final class DiffusionGitRequest extends DiffusionRequest {
return $this->commit;
}
return $this->getResolvableBranchName($this->getBranch());
}
protected function getResolvableBranchName($branch) {
if ($this->repository->isWorkingCopyBare()) {
return $this->getBranch();
return $branch;
} else {
$remote = DiffusionBranchInformation::DEFAULT_GIT_REMOTE;
return $remote.'/'.$this->getBranch();
return $remote.'/'.$branch;
}
}

View file

@ -643,7 +643,7 @@ abstract class DiffusionRequest {
}
if ($this->getSupportsBranches()) {
$branch = $this->getBranch();
$branch = $this->getResolvableBranchName($this->getBranch());
} else {
$branch = 'HEAD';
}
@ -660,6 +660,10 @@ abstract class DiffusionRequest {
return $this->stableCommitName;
}
protected function getResolvableBranchName($branch) {
return $branch;
}
private function resolveRefs(array $refs) {
if ($this->shouldInitFromConduit()) {
return DiffusionQuery::callConduitWithDiffusionRequest(