1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-29 10:12:41 +01:00

[Wilds] Make "Bundle" test cases pass

Summary:
Ref T13098. Continue to chip away at unit tests.

I stubbed out the read of configuration directly from `RepositoryAPI` and would like to remove it later. This is the only configuration value that `RepositoryAPI` reads directly. Instead, I suspect this will be cleaner if higher-level callers are responsible for reading and applying commit range rules and the actual `RepositorAPI` object does not know about them.

(In this particular case it's pretty moot anyway since unit tests shouldn't depend on `.arcconfig` settings.)

Test Plan: Ran unit tests, got slightly fewer failures.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13098

Differential Revision: https://secure.phabricator.com/D19713
This commit is contained in:
epriestley 2018-09-27 10:39:23 -07:00
parent 964707ffdf
commit fe8f0aea9c
2 changed files with 5 additions and 7 deletions

View file

@ -111,14 +111,13 @@ EODIFF;
execx('git reset --hard %s --', $commit_hash);
$fixture_path = $fixture->getPath();
$working_copy = ArcanistWorkingCopyIdentity::newFromPath($fixture_path);
$working_copy = ArcanistWorkingCopy::newFromWorkingDirectory(
$fixture_path);
$configuration_manager = new ArcanistConfigurationManager();
$configuration_manager->setWorkingCopyIdentity($working_copy);
$repository_api = ArcanistRepositoryAPI::newAPIFromConfigurationManager(
$configuration_manager);
$repository_api = $working_copy->newRepositoryAPI();
$repository_api->setBaseCommitArgumentRules('arc:this');
$diff = $repository_api->getFullGitDiff(
$repository_api->getBaseCommit(),
$repository_api->getHeadCommit());

View file

@ -657,9 +657,8 @@ abstract class ArcanistRepositoryAPI extends Phobject {
'user' => '',
'system' => '',
);
$all_sources = $this->configurationManager->getConfigFromAllSources('base');
$base_commit_rules = $all_sources + $base_commit_rules;
// TOOLSETS: Handle "base" configuration.
$parser = new ArcanistBaseCommitParser($this);
$commit = $parser->resolveBaseCommit($base_commit_rules);