Problem:
since pull is run in the background, GitRepositoryAction starts the final tasks (VFS refresh, delayed tasks execution) before the task completes.
Solution:
Introduce the flag-method executeFinalTasksSynchronously, and return false from the actions which are asynchronous and should call the tasks themselves.
These actions are pull and fetch (final tasks are not needed for the latter).
Execute delayed tasks of GitMergeUtil in AWT later, because now they are called on a pooled thread on certain actions.
* IDEA-81862
Remove "Commit File", which is used rarely used and is semi-duplicated by "Commit Changes...".
Add "Resolve Conflicts" and "Fetch".
* Move "Add to VCS" to the bottom so that other actions shortcuts don't shift for unversioned file.
Also because "A" is a perfect mnemonic for "Add".
* Allow alpha-mnemonics for the popup, because there may be more than 10 actions there.
Root cause:
Race condition around verifyPossiblyUntrackedFiles():
1) AWT: File created. Added to myPossiblyUntrackedFiles.
2) T2: starts background thread T2 to check file for ignorance and add it to Git.
3) T1: File is marked dirty, its status is queried by GitChangeProvider in T1.
4) T1: verifyPossiblyUntrackedFiles asks the state of the file, it is untracked, and it is put into untrackedFiles temp variable.
5) T2: File is added to Git.
6) T2: File is removed from myDUF, it is not there, but nobody cares.
7) T1: File is added to myDUF from verifyPossiblyUntrackedFiles.
Solution:
Check untracked files under the lock.
The LOCK is used in after() => not to lock the AWT, use a separate lock for myDefinitelyUntrackedFiles, leaving the LOCK for myReady and myPossiblyUntrackedFiles.
Don't check for myReady in add()/remove() - it is not necessary.