mingw_rmdir: do not prompt for retry when non-empty
authorErik Faye-Lund <kusmabite@gmail.com>
Mon, 10 Dec 2012 14:42:27 +0000 (15:42 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Dec 2012 16:23:53 +0000 (08:23 -0800)
commita83b2b578c04a2abe33a586ec9c64e75ef5bc819
tree5b215f63700b0233f37d874fe2a40c7abfad0eb8
parent84adb641545f4b58f9276adf099f840ea2928e44
mingw_rmdir: do not prompt for retry when non-empty

in ab1a11be ("mingw_rmdir: set errno=ENOTEMPTY when appropriate"),
a check was added to prevent us from retrying to delete a directory
that is both in use and non-empty.

However, this logic was slightly flawed; since we didn't return
immediately, we end up falling out of the retry-loop, but right into
the prompting-loop.

Fix this by setting errno, and guarding the prompting-loop with an
errno-check.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c