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

Add using to avoid crash in Release mode #1311

Merged
merged 2 commits into from
Nov 10, 2017

Conversation

jcansdale
Copy link
Collaborator

@jcansdale jcansdale commented Nov 10, 2017

Somehow putting the repo object in a using avoids the following issue: #1306

Fixes #1306

Somehow putting the `repo` object in a `using` avoids the following issue:
#1306
@jcansdale jcansdale force-pushed the fixes/1306-retrieve-status-crash branch from 12c1c9f to 578c5f1 Compare November 10, 2017 14:06
@jcansdale
Copy link
Collaborator Author

jcansdale commented Nov 10, 2017

@ethomson, any idea why simply adding using statement might prevent a crash that only occurs when compiled in Release mode? I'm very confused!

Here is where the crash was happening:
image

image

Sometimes it would manifest itself like this:

LibGit2Sharp.NotFoundException: no submodule named 'submodules/splat'
   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
   at LibGit2Sharp.Core.Proxy.git_status_list_new(RepositoryHandle repo, GitStatusOptions options)
   at LibGit2Sharp.RepositoryStatus..ctor(Repository repo, StatusOptions options)
   at LibGit2Sharp.RepositoryExtensions.RetrieveStatus(IRepository repository)
   at GitHub.Services.PullRequestService.IsWorkingDirectoryClean(ILocalRepositoryModel repository) in C:\source\github.com\github\VisualStudio\src\GitHub.App\Services\PullRequestService.cs:line 108
   at GitHub.ViewModels.PullRequestDetailViewModel.<Load>d__100.MoveNext() in C:\source\github.com\github\VisualStudio\src\GitHub.App\ViewModels\PullRequestDetailViewModel.cs:line 439

@jcansdale
Copy link
Collaborator Author

Confirmation from @awbushnell that this fix works. 👍

@jcansdale Yes!! I have installed the vsix to both Visual Studio 2015 and Visual Studio 2017 on my local system and in both cases, I have been opening pull requests inside the respective IDE, and no crashes etc. seem to be occurring... Let me know when it is "officially" released to the public and I can get our teams updating to it locally

@jcansdale jcansdale requested a review from grokys November 10, 2017 18:16
Copy link
Contributor

@grokys grokys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving this because it fixes the crash - it would be nice to know why though!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants