Changeset View
Changeset View
Standalone View
Standalone View
src/parser/__tests__/ArcanistBundleTestCase.php
| Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | private function runGitRepositoryTests(PhutilDirectoryFixture $fixture) { | ||||
| // it. | // it. | ||||
| array_pop($commits); | array_pop($commits); | ||||
| foreach ($commits as $commit) { | foreach ($commits as $commit) { | ||||
| list($commit_hash, $tree_hash, $subject) = explode(' ', $commit, 3); | list($commit_hash, $tree_hash, $subject) = explode(' ', $commit, 3); | ||||
| execx('git reset --hard %s --', $commit_hash); | execx('git reset --hard %s --', $commit_hash); | ||||
| $fixture_path = $fixture->getPath(); | $fixture_path = $fixture->getPath(); | ||||
| $working_copy = ArcanistWorkingCopyIdentity::newFromPath($fixture_path); | $working_copy = ArcanistWorkingCopy::newFromWorkingDirectory( | ||||
| $fixture_path); | |||||
| $configuration_manager = new ArcanistConfigurationManager(); | $repository_api = $working_copy->newRepositoryAPI(); | ||||
| $configuration_manager->setWorkingCopyIdentity($working_copy); | |||||
| $repository_api = ArcanistRepositoryAPI::newAPIFromConfigurationManager( | |||||
| $configuration_manager); | |||||
| $repository_api->setBaseCommitArgumentRules('arc:this'); | $repository_api->setBaseCommitArgumentRules('arc:this'); | ||||
| $diff = $repository_api->getFullGitDiff( | $diff = $repository_api->getFullGitDiff( | ||||
| $repository_api->getBaseCommit(), | $repository_api->getBaseCommit(), | ||||
| $repository_api->getHeadCommit()); | $repository_api->getHeadCommit()); | ||||
| $parser = new ArcanistDiffParser(); | $parser = new ArcanistDiffParser(); | ||||
| $parser->setRepositoryAPI($repository_api); | $parser->setRepositoryAPI($repository_api); | ||||
| $changes = $parser->parseDiff($diff); | $changes = $parser->parseDiff($diff); | ||||
| ▲ Show 20 Lines • Show All 859 Lines • Show Last 20 Lines | |||||