@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Conditionally restore some "remote/" stuff removed by rP59922b7

Summary: Fixes T4035. I removed these two "remote/" things in rP59922b7, but we need them for non-bare repositories. Without them, the commands work and run fine and the output looks OK, but the results may not reflect the correct information (e.g., the log shows the working copy's master, which may not be in the same state as origin/master). I'm going to generally clean this up, but unbreak it for now.

Test Plan: Viewed bare and non-bare repositories in Diffusion, got accurate history.

Reviewers: btrahan, hach-que

Reviewed By: btrahan

CC: aran, mbishopim3

Maniphest Tasks: T4035

Differential Revision: https://secure.phabricator.com/D7445

+18 -4
+11 -3
src/applications/diffusion/query/stablecommitname/DiffusionGitStableCommitNameQuery.php
··· 6 6 protected function executeQuery() { 7 7 $repository = $this->getRepository(); 8 8 $branch = $this->getBranch(); 9 - list($stdout) = $repository->execxLocalCommand( 10 - 'rev-parse --verify %s', 11 - $branch); 9 + 10 + if ($repository->isWorkingCopyBare()) { 11 + list($stdout) = $repository->execxLocalCommand( 12 + 'rev-parse --verify %s', 13 + $branch); 14 + } else { 15 + list($stdout) = $repository->execxLocalCommand( 16 + 'rev-parse --verify %s/%s', 17 + DiffusionBranchInformation::DEFAULT_GIT_REMOTE, 18 + $branch); 19 + } 12 20 13 21 $commit = trim($stdout); 14 22 return substr($commit, 0, 16);
+7 -1
src/applications/diffusion/request/DiffusionGitRequest.php
··· 31 31 if ($this->commit) { 32 32 return $this->commit; 33 33 } 34 - return $this->getBranch(); 34 + 35 + if ($this->repository->isWorkingCopyBare()) { 36 + return $this->getBranch(); 37 + } else { 38 + $remote = DiffusionBranchInformation::DEFAULT_GIT_REMOTE; 39 + return $remote.'/'.$this->getBranch(); 40 + } 35 41 } 36 42 37 43 }