1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 16:52:40 +01:00

(stable) Promote 2018 Week 16

This commit is contained in:
epriestley 2018-04-20 14:53:30 -07:00
commit 23f199bf18
3 changed files with 17 additions and 1 deletions

View file

@ -660,14 +660,18 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
$parts = explode("\0", $stdout);
while (count($parts) > 1) {
$entry = array_shift($parts);
$entry_parts = explode(' ', $entry);
$entry_parts = explode(' ', $entry, 2);
if ($entry_parts[0] == '1') {
$entry_parts = explode(' ', $entry, 9);
$path = $entry_parts[8];
} else if ($entry_parts[0] == '2') {
$entry_parts = explode(' ', $entry, 10);
$path = $entry_parts[9];
} else if ($entry_parts[0] == 'u') {
$entry_parts = explode(' ', $entry, 11);
$path = $entry_parts[10];
} else if ($entry_parts[0] == '?') {
$entry_parts = explode(' ', $entry, 2);
$result[$entry_parts[1]] = self::FLAG_UNTRACKED;
continue;
}

View file

@ -7,6 +7,7 @@ final class ArcanistRepositoryAPIStateTestCase extends PhutilTestCase {
$this->parseState('git_basic.git.tgz');
$this->parseState('git_submodules_dirty.git.tgz');
$this->parseState('git_submodules_staged.git.tgz');
$this->parseState('git_spaces.git.tgz');
} else {
$this->assertSkipped(pht('Git is not installed'));
}
@ -156,6 +157,17 @@ final class ArcanistRepositoryAPIStateTestCase extends PhutilTestCase {
);
$this->assertEqual($expect_uncommitted, $api->getUncommittedStatus());
break;
case 'git_spaces.git.tgz':
$expect_working = array(
'SPACES ADDED' => $f_add,
'SPACES DELETED' => $f_del,
'SPACES MODIFIED' => $f_mod,
'SPACES UNCOMMITTED' => $f_add | $f_unc,
'SPACES UNSTAGED' => $f_add | $f_mod | $f_uns | $f_unc,
'SPACES UNTRACKED' => $f_unt,
);
$this->assertEqual($expect_working, $api->getWorkingCopyStatus());
break;
case 'hg_basic.hg.tgz':
$expect_uncommitted = array(
'UNCOMMITTED' => $f_mod | $f_unc,

Binary file not shown.