You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
Instead of isdir(...) && rm(...), wouldn't it be better to say try rm(...) end? This avoids a race condition if the cache directory is deleted between the isdir and `rm.
The reason will be displayed to describe this comment to others. Learn more.
This is in a catch where an error is being thrown anyway, and just makes the error from git get rethrown instead of an error from rm.
The raciness of this idiom is a bigger issue and is probably worth reconsidering a force keyword argument which would be cleaner imo than putting try end everywhere.
eb31eef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this failure case was fixed for master (libgit2) in e4ac8bd
eb31eef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of
isdir(...) && rm(...)
, wouldn't it be better to saytry rm(...) end
? This avoids a race condition if the cache directory is deleted between theisdir
and `rm.eb31eef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in a catch where an error is being thrown anyway, and just makes the error from git get rethrown instead of an error from rm.
The raciness of this idiom is a bigger issue and is probably worth reconsidering a
force
keyword argument which would be cleaner imo than puttingtry end
everywhere.eb31eef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for
force
, in particular if it only ignored non-existing files, and would still throw if the file exists and cannot be deleted.