public static bool delete_Repository(this API_NGit nGit) { nGit.close(); if (nGit.files_Location().valid()) { var folderToDelete = nGit.git_Folder(); if (folderToDelete.dirExists()) { //need to make the repo files read/write before deleting the repo folder foreach (var file in folderToDelete.files(true)) { file.file_Attribute_ReadOnly_Remove(); } return(Files.deleteFolder(folderToDelete, true)); } } return(false); }
public static string git_Folder(this API_NGit nGit) { return(nGit.files_Location().pathCombine(".git")); }