Page MenuHomePhabricator

D7445.id16774.diff
No OneTemporary

D7445.id16774.diff

Index: src/applications/diffusion/query/stablecommitname/DiffusionGitStableCommitNameQuery.php
===================================================================
--- src/applications/diffusion/query/stablecommitname/DiffusionGitStableCommitNameQuery.php
+++ src/applications/diffusion/query/stablecommitname/DiffusionGitStableCommitNameQuery.php
@@ -6,9 +6,17 @@
protected function executeQuery() {
$repository = $this->getRepository();
$branch = $this->getBranch();
- list($stdout) = $repository->execxLocalCommand(
- 'rev-parse --verify %s',
- $branch);
+
+ if ($repository->isWorkingCopyBare()) {
+ list($stdout) = $repository->execxLocalCommand(
+ 'rev-parse --verify %s',
+ $branch);
+ } else {
+ list($stdout) = $repository->execxLocalCommand(
+ 'rev-parse --verify %s/%s',
+ DiffusionBranchInformation::DEFAULT_GIT_REMOTE,
+ $branch);
+ }
$commit = trim($stdout);
return substr($commit, 0, 16);
Index: src/applications/diffusion/request/DiffusionGitRequest.php
===================================================================
--- src/applications/diffusion/request/DiffusionGitRequest.php
+++ src/applications/diffusion/request/DiffusionGitRequest.php
@@ -31,7 +31,13 @@
if ($this->commit) {
return $this->commit;
}
- return $this->getBranch();
+
+ if ($this->repository->isWorkingCopyBare()) {
+ return $this->getBranch();
+ } else {
+ $remote = DiffusionBranchInformation::DEFAULT_GIT_REMOTE;
+ return $remote.'/'.$this->getBranch();
+ }
}
}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 11, 2:12 AM (1 d, 23 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6711581
Default Alt Text
D7445.id16774.diff (1 KB)

Event Timeline