]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix arc lint amend for git to not add untracked files
authordurham <durham@fb.com>
Fri, 19 Apr 2013 03:03:26 +0000 (20:03 -0700)
committerdurham <durham@fb.com>
Fri, 19 Apr 2013 03:03:26 +0000 (20:03 -0700)
Summary:
Arc lint for git is currently adding all untracked files when it
amends the commit with lint fixes. This changes the git add -A to be
git add -u. This only adds files that were already tracked. -A was adding
untracked files as well which was not the desired behavior here.

Test Plan:
Create an untracked file.
Commit a lint failure another file.

arc diff and choose to amend the lint patches.

Verify that the untracked file was not added but the tracked file was amended.

Reviewers: epriestley, wez, chad

Reviewed By: chad

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D5731

src/workflow/ArcanistLintWorkflow.php

index bf2c84e20ec4e44e848cb60a8dfc3e6671ac2040..0290951547b7e67f9afd0e74750941bc03ad7970 100644 (file)
@@ -481,7 +481,7 @@ EOTEXT
       if ($amend) {
         if ($repository_api instanceof ArcanistGitAPI) {
           // Add the changes to the index before amending
-          $repository_api->execxLocal('add -A');
+          $repository_api->execxLocal('add -u');
         }
 
         $repository_api->amendCommit();