Skip to content

Commit 766f654

Browse files
committed
Fix exception thrown from nbgv get-commits when run outside a repo
1 parent 717ee4c commit 766f654

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/nbgv/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,14 +820,14 @@ private static Task<int> OnGetCommitsCommand(string project, bool quiet, string
820820

821821
string searchPath = GetSpecifiedOrCurrentDirectoryPath(project);
822822

823-
using var context = (LibGit2Context)GitContext.Create(searchPath, engine: GitContext.Engine.ReadWrite);
823+
using var context = GitContext.Create(searchPath, engine: GitContext.Engine.ReadWrite);
824824
if (!context.IsRepository)
825825
{
826826
Console.Error.WriteLine("No git repo found at or above: \"{0}\"", searchPath);
827827
return Task.FromResult((int)ExitCodes.NoGitRepo);
828828
}
829829

830-
IEnumerable<LibGit2Sharp.Commit> candidateCommits = LibGit2GitExtensions.GetCommitsFromVersion(context, parsedVersion);
830+
IEnumerable<LibGit2Sharp.Commit> candidateCommits = LibGit2GitExtensions.GetCommitsFromVersion((LibGit2Context)context, parsedVersion);
831831
PrintCommits(quiet, context, candidateCommits);
832832

833833
return Task.FromResult((int)ExitCodes.OK);

0 commit comments

Comments
 (0)