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

Correctly detect uncommitted files in Git

Summary:
I simplified this code at some point and broke it horribly
in the process. Mask in the right flag here and combine the maps
correctly. This solves the great mystery of increased developer
clowniness.

Test Plan:
Ran 'arc diff' in a working copy with staged but
uncommitted files, got an error message (previously, I didn't).

Reviewed By: aran
Reviewers: mroch, aran
CC: aran
Differential Revision: 104
This commit is contained in:
epriestley 2011-04-05 19:27:05 -07:00
parent 1dd69bdbee
commit 1139eb1a73

View file

@ -168,7 +168,14 @@ class ArcanistGitAPI extends ArcanistRepositoryAPI {
list($stdout) = execx(
'(cd %s; git diff --no-ext-diff --raw HEAD --)',
$this->getPath());
$files += $this->parseGitStatus($stdout);
$uncommitted_files = $this->parseGitStatus($stdout);
foreach ($uncommitted_files as $path => $mask) {
$mask |= self::FLAG_UNCOMMITTED;
if (!isset($files[$path])) {
$files[$path] = 0;
}
$files[$path] |= $mask;
}
// Find untracked files.
list($stdout) = execx(