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

Commit 96fab8d

Browse files
committed
Stop GitServiceHelper from depending on MEF
1 parent 36e680e commit 96fab8d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/GitHub.Exports/Services/GitService.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,13 @@ public UriString GetRemoteUri(IRepository repo, string remote = "origin")
7474
?.Url;
7575
}
7676

77-
public static IGitService GitServiceHelper => VisualStudio.Services.DefaultExportProvider.GetExportedValueOrDefault<IGitService>() ?? new GitService();
77+
/// <summary>
78+
/// Get a new instance of <see cref="GitService"/>.
79+
/// </summary>
80+
/// <remarks>
81+
/// This is equivalent to creating it via MEF with <see cref="CreationPolicy.NonShared"/>
82+
/// </remarks>
83+
public static IGitService GitServiceHelper => new GitService();
7884

7985
/// <summary>
8086
/// Finds the latest pushed commit of a file and returns the sha of that commit. Returns null when no commits have

0 commit comments

Comments
 (0)