Files
openide/plugins
Kirill Likhodedov a30e7bbd67 IDEA-118140 don't add unversioned file to VCS on file move
The bug was introduced in 783963b while fixing IDEA-153272.
Originally the code used to avoid registering unversioned and ignored
moved files in performMoveRename(), thus they were not passed to
`git add/rm` in executeMoveRename(), thus they were correctly not added
to the VCS.

But that behavior led to IDEA-153272 (both files are lost
when unversioned file is moved to overwrite existing file of the same name)
Here is what actually happened:
1. Delete original file to let it be overwritten.
2. beforeFileDeleted: remember to git rm this file later.
3. Move unversioned file to the place of original.
4. Don't remember the file because it is unversioned.
5. git rm the original file from executeDelete() after the command finished.
=> both unversioned (during the move) and original (during git rm)
were deleted.

The fix in 783963b was to avoid #4 in this sequence. However,
moved unversioned files were not filtered anymore, and thus were later
passed to executeMoveRename and further to `git add/rm/mv`.

This fix is actually a partial revert of 783963b: it returns filtering
by UNKNOWN/INGORED file status back (with a special handle for Perforce),
but in order to keep IDEA-153272 fixed it moves the unversioned & ignored check
from performMoveRename to executeMoveRename. The latter is called after
files are checked for doNotDeleteAddedCopiedOrMovedFiles => file is
not scheduled for deletion anymore even if it was unversioned moved file.

Tests were added for both IDEA-153272 and IDEA-118140.
2016-07-23 13:45:38 +03:00
..
2016-07-18 15:33:31 +02:00
2016-07-22 15:43:35 +03:00
2016-07-19 13:42:42 +02:00