mingw: make failures to unlink or move raise a question
commitef3ad5023aab2d8438c6eef53a9d6a02b27d90ca
authorHeiko Voigt <hvoigt@hvoigt.net>
Sun, 21 Feb 2010 20:19:42 +0000 (21 21:19 +0100)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 11 Aug 2010 13:47:19 +0000 (11 15:47 +0200)
treec894b3c24ce54b6aaa0ced15eb468b63ea85d400
parentc4ade8372ab694d5dda4f3bfb715ddc5afb78168
mingw: make failures to unlink or move raise a question

On Windows in case a program is accessing a file unlink or
move operations may fail. To give the user a chance to correct
this we simply wait until the user asks us to retry or fail.

This is useful because of the following use case which seem
to happen rarely but when it does it is a mess:

After making some changes the user realizes that he was on the
incorrect branch. When trying to change the branch some file
is still in use by some other process and git stops in the
middle of changing branches. Now the user has lots of files
with changes mixed with his own. This is especially confusing
on repositories that contain lots of files.

Although the recent implementation of automatic retry makes
this scenario much more unlikely lets provide a fallback as
a last resort.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
compat/mingw.c