@@ -30,6 +30,7 @@ public static ICommit CreateMockCommit()
30
30
commit . When . Returns ( when . AddSeconds ( 1 ) ) ;
31
31
return commit ;
32
32
}
33
+
33
34
public static IBranch CreateMockBranch ( string name , params ICommit [ ] commits )
34
35
{
35
36
var branch = Substitute . For < IBranch > ( ) ;
@@ -55,13 +56,13 @@ public static void DiscoverRepository(this IServiceProvider sp)
55
56
56
57
public static IBranch FindBranch ( this IGitRepository repository , string branchName )
57
58
=> repository . Branches . FirstOrDefault ( branch => branch . Name . WithoutOrigin == branchName )
58
- ?? throw new GitVersionException ( $ "Branch { branchName } not found") ;
59
+ ?? throw new GitVersionException ( $ "Branch { branchName } not found") ;
59
60
60
61
public static void DumpGraph ( this IGitRepository repository , Action < string > ? writer = null , int ? maxCommits = null )
61
- => GitExtensions . DumpGraph ( repository . Path , writer , maxCommits ) ;
62
+ => DumpGraph ( repository . Path , writer , maxCommits ) ;
62
63
63
64
public static void DumpGraph ( this IRepository repository , Action < string > ? writer = null , int ? maxCommits = null )
64
- => GitExtensions . DumpGraph ( repository . ToGitRepository ( ) . Path , writer , maxCommits ) ;
65
+ => DumpGraph ( repository . ToGitRepository ( ) . Path , writer , maxCommits ) ;
65
66
66
67
public static GitVersionVariables GetVersion ( this RepositoryFixtureBase fixture , IGitVersionConfiguration ? configuration = null ,
67
68
IRepository ? repository = null , string ? commitId = null , bool onlyTrackedBranches = true , string ? targetBranch = null )
@@ -173,4 +174,7 @@ private static IServiceProvider ConfigureServices(Action<IServiceCollection>? se
173
174
servicesOverrides ? . Invoke ( services ) ;
174
175
return services . BuildServiceProvider ( ) ;
175
176
}
177
+
178
+ private static void DumpGraph ( string workingDirectory , Action < string > ? writer = null , int ? maxCommits = null )
179
+ => GitTestExtensions . ExecuteGitCmd ( GitExtensions . CreateGitLogArgs ( maxCommits ) , workingDirectory , writer ) ;
176
180
}
0 commit comments