Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Warn if user tries to open solution file that isn't checked out
Browse files Browse the repository at this point in the history
Stop user from opening solution files that aren't related to the target PR diff file.
  • Loading branch information
jcansdale committed Jan 12, 2018
1 parent 6415049 commit 4ae78f8
Showing 1 changed file with 13 additions and 0 deletions.
Expand Up @@ -132,6 +132,12 @@ async Task DoOpenLiveFile(IPullRequestFileNode file)
{
try
{
if (!ViewModel.IsCheckedOut)
{
ShowInfoMessage("Checkout PR branch before opening file in solution.");
return;
}

var fullPath = ViewModel.GetLocalFilePath(file);

var activeView = NavigationService.FindActiveView();
Expand All @@ -152,6 +158,13 @@ async Task DoOpenLiveFile(IPullRequestFileNode file)
}
}

static void ShowInfoMessage(string message)
{
ErrorHandler.ThrowOnFailure(VsShellUtilities.ShowMessageBox(
Services.GitHubServiceProvider, message, null,
OLEMSGICON.OLEMSGICON_INFO, OLEMSGBUTTON.OLEMSGBUTTON_OK, OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST));
}

async Task DoDiffFile(IPullRequestFileNode file, bool workingDirectory)
{
try
Expand Down

0 comments on commit 4ae78f8

Please sign in to comment.