mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-02-16 16:58:38 +01:00
Don't interpret arc browse .
as a commit
Summary: Ref T5781. `git show .` works like HEAD, but that isn't what `arc browse .` means. Test Plan: Ran `arc browse .` with a repository at a published commit. Reviewers: chad, btrahan, avive, avivey Reviewed By: avivey Subscribers: epriestley, avivey Maniphest Tasks: T5781 Differential Revision: https://secure.phabricator.com/D10197
This commit is contained in:
parent
7bd57bfd9c
commit
377eb5d1e0
2 changed files with 14 additions and 4 deletions
|
@ -535,7 +535,7 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
|
|||
$stdout = $this->getHashFromFromSVNRevisionNumber($match[1]);
|
||||
} else {
|
||||
list($stdout) = $this->execxLocal(
|
||||
'show -s --format=%C %s',
|
||||
'show -s --format=%s %s --',
|
||||
'%H',
|
||||
$string);
|
||||
}
|
||||
|
|
|
@ -104,9 +104,19 @@ EOTEXT
|
|||
|
||||
$commits = array();
|
||||
foreach ($things as $key => $thing) {
|
||||
$commit = $repository_api->getCanonicalRevisionName($thing);
|
||||
if ($commit) {
|
||||
$commits[$commit] = $key;
|
||||
if ($thing == '.') {
|
||||
// Git resolves '.' like HEAD, but it should be interpreted to mean
|
||||
// "the current directory". Just skip resolution and fall through.
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
$commit = $repository_api->getCanonicalRevisionName($thing);
|
||||
if ($commit) {
|
||||
$commits[$commit] = $key;
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
// Ignore.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue