mingw: make failures to unlink or move raise a question
commit1f528310be0c0c7b2e426a8c3d4f1c0ac60fa17b
authorHeiko Voigt <hvoigt@hvoigt.net>
Sun, 21 Feb 2010 20:19:42 +0000 (21 21:19 +0100)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Fri, 17 Sep 2010 09:30:10 +0000 (17 10:30 +0100)
tree56803f420cc4c998f851bf6143293b9380d5baa1
parent928aae7529aa26198e01cd3dabe67e9f4dc3d1ca
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