summaryrefslogtreecommitdiffstats
path: root/contrib/persistent-https
diff options
context:
space:
mode:
authorKarsten Blees <karsten.blees@gmail.com>2026-01-09 20:05:04 +0000
committerJunio C Hamano <gitster@pobox.com>2026-01-09 18:32:55 -0800
commitb0b32ff16ffc0448b4522997667086e31715424f (patch)
tree74c7797b82cd7589234997ab7b14b255cf286309 /contrib/persistent-https
parent543a91ccf9ba551eb563abb44eef0deadf3e38b7 (diff)
downloadgit-b0b32ff16ffc0448b4522997667086e31715424f.tar.gz
git-b0b32ff16ffc0448b4522997667086e31715424f.zip
mingw: factor out the retry logic
In several places, Git's Windows-specific code follows the pattern where it tries to perform an operation, and retries several times when that operation fails, sleeping an increasing amount of time, before finally giving up and asking the user whether to rety (after, say, closing an editor that held a handle to a file, preventing the operation from succeeding). This logic is a bit hard to use, and inconsistent: `mingw_unlink()` and `mingw_rmdir()` duplicate the code to retry, and both of them do so incompletely. They also do not restore `errno` if the user answers 'no'. Introduce a `retry_ask_yes_no()` helper function that handles retry with small delay, asking the user, and restoring `errno`. Note that in `mingw_unlink()`, we include the `_wchmod()` call in the retry loop (which may fail if the file is locked exclusively). In `mingw_rmdir()`, we include special error handling in the retry loop. Signed-off-by: Karsten Blees <karsten.blees@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions