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

Commit bbbe930

Browse files
committed
Load GitContextPackage in UICONTEXT.RepositoryOpen
Only load the GitContextPackage when there is an open repository.
1 parent 67f9b6d commit bbbe930

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/GitHub.VisualStudio/GitContextPackage.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55
using GitHub.Services;
66
using Microsoft.VisualStudio.Shell;
77
using Task = System.Threading.Tasks.Task;
8+
using static Microsoft.VisualStudio.VSConstants;
89

910
namespace GitHub.VisualStudio
1011
{
1112
/// <summary>
1213
/// This package creates a custom UIContext <see cref="Guids.UIContext_Git"/> that is activated when a
13-
/// repository is active in <see cref="IVSGitExt"/>.
14+
/// repository is active in <see cref="IVSGitExt"/> and the current process is Visual Studio (not Blend).
1415
/// </summary>
1516
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
1617
[Guid(Guids.UIContext_Git)]
17-
// this is the Git service GUID, so we load whenever it loads
18-
[ProvideAutoLoad(Guids.GitSccProviderId, PackageAutoLoadFlags.BackgroundLoad)]
18+
// Initialize when we enter the context of a Git repository
19+
[ProvideAutoLoad(UICONTEXT.RepositoryOpen_string, PackageAutoLoadFlags.BackgroundLoad)]
1920
public class GitContextPackage : AsyncPackage
2021
{
2122
protected async override Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)

0 commit comments

Comments
 (0)