IDEA-191309 git: update staging area using "--cached" argument on commit

fix "error: the following file has local modifications" on attempt to
call `git rm -- <before-rename path>` on a renamed file, excluded from commit.
This might be caused by git pre-commit-hook, that created file with
that path during the commit.
(so no now it is a modification + new file, and not a rename).
This commit is contained in:
Aleksey Pivovarov
2018-05-13 19:06:40 +03:00
parent edbac54385
commit 583bc17b5c
@@ -658,7 +658,7 @@ public class GitCheckinEnvironment implements CheckinEnvironment {
}
if (!removed.isEmpty()) {
try {
GitFileUtils.delete(project, root, removed, "--ignore-unmatch");
GitFileUtils.delete(project, root, removed, "--ignore-unmatch", "--cached");
}
catch (VcsException ex) {
exceptions.add(ex);