{"action":"created","comment":{"url":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/comments/25137260","id":25137260,"diff_hunk":"@@ -71,16 +72,37 @@ public static void DeleteDirectory(string directoryPath)\n             File.SetAttributes(directoryPath, FileAttributes.Normal);\n             try\n             {\n-                Directory.Delete(directoryPath, false);\n+                Directory.Delete(directoryPath, true);\n             }\n-            catch (IOException)\n+            catch (IOException ex1)\n             {\n-                Trace.WriteLine(string.Format(\"{0}The directory '{1}' could not be deleted!\" +\n-                                                    \"{0}Most of the time, this is due to an external process accessing the files in the temporary repositories created during the test runs, and keeping a handle on the directory, thus preventing the deletion of those files.\" +\n-                                                    \"{0}Known and common causes include:\" +\n-                                                    \"{0}- Windows Search Indexer (go to the Indexing Options, in the Windows Control Panel, and exclude the bin folder of LibGit2Sharp.Tests)\" +\n-                                                    \"{0}- Antivirus (exclude the bin folder of LibGit2Sharp.Tests from the paths scanned by your real-time antivirus){0}\",\n-                    Environment.NewLine, Path.GetFullPath(directoryPath)));\n+                // Retry if the directory was allegedly not found or not empty.","path":"LibGit2Sharp.Tests/TestHelpers/DirectoryHelper.cs","position":49,"original_position":49,"commit_id":"d007b4f94bb320a0755b8cba2d2ff1172abe80bb","original_commit_id":"d007b4f94bb320a0755b8cba2d2ff1172abe80bb","user":{"login":"ThomasBarnekow","id":8481516,"avatar_url":"https://avatars.githubusercontent.com/u/8481516?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasBarnekow","html_url":"https://github.com/ThomasBarnekow","followers_url":"https://api.github.com/users/ThomasBarnekow/followers","following_url":"https://api.github.com/users/ThomasBarnekow/following{/other_user}","gists_url":"https://api.github.com/users/ThomasBarnekow/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasBarnekow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasBarnekow/subscriptions","organizations_url":"https://api.github.com/users/ThomasBarnekow/orgs","repos_url":"https://api.github.com/users/ThomasBarnekow/repos","events_url":"https://api.github.com/users/ThomasBarnekow/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasBarnekow/received_events","type":"User","site_admin":false},"body":"What do you mean with \"may indeed make sense\"? This performs up to two retries before throwing. And that *only* happens when an ```UnauthorizedAccessException``` is caught twice.\r\n\r\nAs I wrote before, in most cases there are no leftover folders at all because the new approach cleans them up successfully. In the worst case, e.g., if TortoiseGit gets in the way because it is not correctly configured to exclude the bin directory, only very few directories (e.g., one or two) are not deleted and remain in the ```TestRepos``` folder. That is much better than the 20 or more that we had before.","created_at":"2015-02-22T22:02:01Z","updated_at":"2015-02-22T22:02:01Z","html_url":"https://github.com/libgit2/libgit2sharp/pull/971#discussion_r25137260","pull_request_url":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/971","_links":{"self":{"href":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/comments/25137260"},"html":{"href":"https://github.com/libgit2/libgit2sharp/pull/971#discussion_r25137260"},"pull_request":{"href":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/971"}}},"pull_request":{"url":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/971","id":29757158,"html_url":"https://github.com/libgit2/libgit2sharp/pull/971","diff_url":"https://github.com/libgit2/libgit2sharp/pull/971.diff","patch_url":"https://github.com/libgit2/libgit2sharp/pull/971.patch","issue_url":"https://api.github.com/repos/libgit2/libgit2sharp/issues/971","number":971,"state":"open","locked":false,"title":"Fixed issue #970","user":{"login":"ThomasBarnekow","id":8481516,"avatar_url":"https://avatars.githubusercontent.com/u/8481516?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasBarnekow","html_url":"https://github.com/ThomasBarnekow","followers_url":"https://api.github.com/users/ThomasBarnekow/followers","following_url":"https://api.github.com/users/ThomasBarnekow/following{/other_user}","gists_url":"https://api.github.com/users/ThomasBarnekow/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasBarnekow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasBarnekow/subscriptions","organizations_url":"https://api.github.com/users/ThomasBarnekow/orgs","repos_url":"https://api.github.com/users/ThomasBarnekow/repos","events_url":"https://api.github.com/users/ThomasBarnekow/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasBarnekow/received_events","type":"User","site_admin":false},"body":"This pull request fixes issue #970.","created_at":"2015-02-21T18:04:35Z","updated_at":"2015-02-22T22:02:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6edd8dd0225a071d32e4f1ab7e69222d17c88c50","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/971/commits","review_comments_url":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/971/comments","review_comment_url":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/libgit2/libgit2sharp/issues/971/comments","statuses_url":"https://api.github.com/repos/libgit2/libgit2sharp/statuses/d007b4f94bb320a0755b8cba2d2ff1172abe80bb","head":{"label":"ThomasBarnekow:directory-helper-fix","ref":"directory-helper-fix","sha":"d007b4f94bb320a0755b8cba2d2ff1172abe80bb","user":{"login":"ThomasBarnekow","id":8481516,"avatar_url":"https://avatars.githubusercontent.com/u/8481516?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasBarnekow","html_url":"https://github.com/ThomasBarnekow","followers_url":"https://api.github.com/users/ThomasBarnekow/followers","following_url":"https://api.github.com/users/ThomasBarnekow/following{/other_user}","gists_url":"https://api.github.com/users/ThomasBarnekow/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasBarnekow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasBarnekow/subscriptions","organizations_url":"https://api.github.com/users/ThomasBarnekow/orgs","repos_url":"https://api.github.com/users/ThomasBarnekow/repos","events_url":"https://api.github.com/users/ThomasBarnekow/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasBarnekow/received_events","type":"User","site_admin":false},"repo":{"id":27309232,"name":"libgit2sharp","full_name":"ThomasBarnekow/libgit2sharp","owner":{"login":"ThomasBarnekow","id":8481516,"avatar_url":"https://avatars.githubusercontent.com/u/8481516?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasBarnekow","html_url":"https://github.com/ThomasBarnekow","followers_url":"https://api.github.com/users/ThomasBarnekow/followers","following_url":"https://api.github.com/users/ThomasBarnekow/following{/other_user}","gists_url":"https://api.github.com/users/ThomasBarnekow/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasBarnekow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasBarnekow/subscriptions","organizations_url":"https://api.github.com/users/ThomasBarnekow/orgs","repos_url":"https://api.github.com/users/ThomasBarnekow/repos","events_url":"https://api.github.com/users/ThomasBarnekow/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasBarnekow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ThomasBarnekow/libgit2sharp","description":"Git + .Net/Mono = ❤","fork":true,"url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp","forks_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/forks","keys_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/teams","hooks_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/hooks","issue_events_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/issues/events{/number}","events_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/events","assignees_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/assignees{/user}","branches_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/branches{/branch}","tags_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/tags","blobs_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/git/refs{/sha}","trees_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/statuses/{sha}","languages_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/languages","stargazers_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/stargazers","contributors_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/contributors","subscribers_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/subscribers","subscription_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/subscription","commits_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/commits{/sha}","git_commits_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/git/commits{/sha}","comments_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/comments{/number}","issue_comment_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/issues/comments{/number}","contents_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/contents/{+path}","compare_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/merges","archive_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/downloads","issues_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/issues{/number}","pulls_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/pulls{/number}","milestones_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/milestones{/number}","notifications_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/labels{/name}","releases_url":"https://api.github.com/repos/ThomasBarnekow/libgit2sharp/releases{/id}","created_at":"2014-11-29T17:15:57Z","updated_at":"2015-02-22T20:18:48Z","pushed_at":"2015-02-22T20:19:29Z","git_url":"git://github.com/ThomasBarnekow/libgit2sharp.git","ssh_url":"git@github.com:ThomasBarnekow/libgit2sharp.git","clone_url":"https://github.com/ThomasBarnekow/libgit2sharp.git","svn_url":"https://github.com/ThomasBarnekow/libgit2sharp","homepage":"http://libgit2.github.com","size":142912,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"vNext"}},"base":{"label":"libgit2:vNext","ref":"vNext","sha":"a0776fa6e811ccc2a65c50e06f8e142a9f09d84d","user":{"login":"libgit2","id":394745,"avatar_url":"https://avatars.githubusercontent.com/u/394745?v=3","gravatar_id":"","url":"https://api.github.com/users/libgit2","html_url":"https://github.com/libgit2","followers_url":"https://api.github.com/users/libgit2/followers","following_url":"https://api.github.com/users/libgit2/following{/other_user}","gists_url":"https://api.github.com/users/libgit2/gists{/gist_id}","starred_url":"https://api.github.com/users/libgit2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libgit2/subscriptions","organizations_url":"https://api.github.com/users/libgit2/orgs","repos_url":"https://api.github.com/users/libgit2/repos","events_url":"https://api.github.com/users/libgit2/events{/privacy}","received_events_url":"https://api.github.com/users/libgit2/received_events","type":"Organization","site_admin":false},"repo":{"id":1415168,"name":"libgit2sharp","full_name":"libgit2/libgit2sharp","owner":{"login":"libgit2","id":394745,"avatar_url":"https://avatars.githubusercontent.com/u/394745?v=3","gravatar_id":"","url":"https://api.github.com/users/libgit2","html_url":"https://github.com/libgit2","followers_url":"https://api.github.com/users/libgit2/followers","following_url":"https://api.github.com/users/libgit2/following{/other_user}","gists_url":"https://api.github.com/users/libgit2/gists{/gist_id}","starred_url":"https://api.github.com/users/libgit2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libgit2/subscriptions","organizations_url":"https://api.github.com/users/libgit2/orgs","repos_url":"https://api.github.com/users/libgit2/repos","events_url":"https://api.github.com/users/libgit2/events{/privacy}","received_events_url":"https://api.github.com/users/libgit2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libgit2/libgit2sharp","description":"Git + .Net/Mono = ❤","fork":false,"url":"https://api.github.com/repos/libgit2/libgit2sharp","forks_url":"https://api.github.com/repos/libgit2/libgit2sharp/forks","keys_url":"https://api.github.com/repos/libgit2/libgit2sharp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libgit2/libgit2sharp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libgit2/libgit2sharp/teams","hooks_url":"https://api.github.com/repos/libgit2/libgit2sharp/hooks","issue_events_url":"https://api.github.com/repos/libgit2/libgit2sharp/issues/events{/number}","events_url":"https://api.github.com/repos/libgit2/libgit2sharp/events","assignees_url":"https://api.github.com/repos/libgit2/libgit2sharp/assignees{/user}","branches_url":"https://api.github.com/repos/libgit2/libgit2sharp/branches{/branch}","tags_url":"https://api.github.com/repos/libgit2/libgit2sharp/tags","blobs_url":"https://api.github.com/repos/libgit2/libgit2sharp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libgit2/libgit2sharp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libgit2/libgit2sharp/git/refs{/sha}","trees_url":"https://api.github.com/repos/libgit2/libgit2sharp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libgit2/libgit2sharp/statuses/{sha}","languages_url":"https://api.github.com/repos/libgit2/libgit2sharp/languages","stargazers_url":"https://api.github.com/repos/libgit2/libgit2sharp/stargazers","contributors_url":"https://api.github.com/repos/libgit2/libgit2sharp/contributors","subscribers_url":"https://api.github.com/repos/libgit2/libgit2sharp/subscribers","subscription_url":"https://api.github.com/repos/libgit2/libgit2sharp/subscription","commits_url":"https://api.github.com/repos/libgit2/libgit2sharp/commits{/sha}","git_commits_url":"https://api.github.com/repos/libgit2/libgit2sharp/git/commits{/sha}","comments_url":"https://api.github.com/repos/libgit2/libgit2sharp/comments{/number}","issue_comment_url":"https://api.github.com/repos/libgit2/libgit2sharp/issues/comments{/number}","contents_url":"https://api.github.com/repos/libgit2/libgit2sharp/contents/{+path}","compare_url":"https://api.github.com/repos/libgit2/libgit2sharp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libgit2/libgit2sharp/merges","archive_url":"https://api.github.com/repos/libgit2/libgit2sharp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libgit2/libgit2sharp/downloads","issues_url":"https://api.github.com/repos/libgit2/libgit2sharp/issues{/number}","pulls_url":"https://api.github.com/repos/libgit2/libgit2sharp/pulls{/number}","milestones_url":"https://api.github.com/repos/libgit2/libgit2sharp/milestones{/number}","notifications_url":"https://api.github.com/repos/libgit2/libgit2sharp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libgit2/libgit2sharp/labels{/name}","releases_url":"https://api.github.com/repos/libgit2/libgit2sharp/releases{/id}","created_at":"2011-02-26T16:44:49Z","updated_at":"2015-02-22T21:41:52Z","pushed_at":"2015-02-21T21:12:42Z","git_url":"git://github.com/libgit2/libgit2sharp.git","ssh_url":"git@github.com:libgit2/libgit2sharp.git","clone_url":"https://github.com/libgit2/libgit2sharp.git","svn_url":"https://github.com/libgit2/libgit2sharp","homepage":"http://libgit2.github.com","size":209724,"stargazers_count":715,"watchers_count":715,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":287,"mirror_url":null,"open_issues_count":125,"forks":287,"open_issues":125,"watchers":715,"default_branch":"vNext"}},"_links":{"self":{"href":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/971"},"html":{"href":"https://github.com/libgit2/libgit2sharp/pull/971"},"issue":{"href":"https://api.github.com/repos/libgit2/libgit2sharp/issues/971"},"comments":{"href":"https://api.github.com/repos/libgit2/libgit2sharp/issues/971/comments"},"review_comments":{"href":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/971/comments"},"review_comment":{"href":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/libgit2/libgit2sharp/pulls/971/commits"},"statuses":{"href":"https://api.github.com/repos/libgit2/libgit2sharp/statuses/d007b4f94bb320a0755b8cba2d2ff1172abe80bb"}}}}