Skip to content

Commit f630d32

Browse files
committed
Remove repository if the directory cannot be found.
1 parent 7714d80 commit f630d32

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,9 @@ private void OpenRepoAssignedToProject()
491491
{
492492
ViewModel_ErrorThrown(null, new ErrorEventArgs(ex.Message, ex.InnerException.Message, NotificationType.Error));
493493
Status = RubberduckUI.Offline;
494+
495+
_config.Repositories.Remove(_config.Repositories.FirstOrDefault(repo => repo.Id == _vbe.ActiveVBProject.HelpFile));
496+
_configService.Save(_config);
494497
}
495498

496499
OnOpenRepoCompleted();
@@ -519,12 +522,10 @@ private bool ValidRepoExists()
519522
}
520523

521524
var possibleRepos = _config.Repositories.Where(repo => repo.Id == _vbe.ActiveVBProject.HelpFile);
522-
523525
var possibleCount = possibleRepos.Count();
524526

525527
//todo: if none are found, prompt user to create one
526-
//todo: more than one are found, prompt for correct one
527-
return possibleCount != 0 && possibleCount <= 1;
528+
return possibleCount == 1;
528529
}
529530

530531
private void ShowFilePicker()

Rubberduck.SourceControl/GitProvider.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public GitProvider(VBProject project, IRepository repository, ICodePaneWrapperFa
3737
}
3838
catch (RepositoryNotFoundException ex)
3939
{
40-
repository = null;
4140
throw new SourceControlException(SourceControlText.GitRepoNotFound, ex);
4241
}
4342
}

0 commit comments

Comments
 (0)