]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Arc cover handles a file that is added and modified correctly.
authortuomaspelkonen <tuomas.pelkonen@fb.com>
Mon, 11 Apr 2011 20:54:00 +0000 (13:54 -0700)
committertuomaspelkonen <tuomas.pelkonen@fb.com>
Mon, 11 Apr 2011 21:08:54 +0000 (14:08 -0700)
Summary:
Modifying a new file and running 'arc cover' before committing the
modifications confused arc. The problem was that 'unstaged' status
erased 'added' status and this caused problems.

Test Plan:
Tested that arc cover ignores added files when they are modified, but
old files that are modified are still handled correctly by arc cover.

Reviewed By: epriestley
Reviewers: epriestley
CC: jungejason, epriestley
Differential Revision: 122

src/repository/api/git/ArcanistGitAPI.php

index 7ac4af56abdd7052208bc7d57b630c5de3b6e641..d74f4dbe1473c5821896c5d66ff082ac04ed2653 100644 (file)
@@ -200,7 +200,9 @@ class ArcanistGitAPI extends ArcanistRepositoryAPI {
       if (strlen($stdout)) {
         $stdout = explode("\n", $stdout);
         foreach ($stdout as $file) {
-          $files[$file] = self::FLAG_UNSTAGED;
+          $files[$file] = isset($files[$file])
+            ? ($files[$file] | self::FLAG_UNSTAGED)
+            : self::FLAG_UNSTAGED;
         }
       }