File tree Expand file tree Collapse file tree 4 files changed +32
-2
lines changed Expand file tree Collapse file tree 4 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -5,12 +5,11 @@ namespace LibGit2Sharp.Core
5
5
{
6
6
internal class GitObjectLazyGroup : LazyGroup < GitObjectSafeHandle >
7
7
{
8
- private readonly Repository repo ;
9
8
private readonly ObjectId id ;
10
9
11
10
public GitObjectLazyGroup ( Repository repo , ObjectId id )
11
+ : base ( repo )
12
12
{
13
- this . repo = repo ;
14
13
this . id = id ;
15
14
}
16
15
Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ internal abstract class LazyGroup<T>
9
9
private readonly IList < IEvaluator < T > > evaluators = new List < IEvaluator < T > > ( ) ;
10
10
private readonly object @lock = new object ( ) ;
11
11
private bool evaluated ;
12
+ protected readonly Repository repo ;
13
+
14
+ protected LazyGroup ( Repository repo )
15
+ {
16
+ this . repo = repo ;
17
+ }
12
18
13
19
public ILazy < TResult > AddLazy < TResult > ( Func < T , TResult > func )
14
20
{
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using LibGit2Sharp . Core . Handles ;
3
+
4
+ namespace LibGit2Sharp . Core
5
+ {
6
+ internal class SubmoduleLazyGroup : LazyGroup < SubmoduleSafeHandle >
7
+ {
8
+ private readonly string name ;
9
+
10
+ public SubmoduleLazyGroup ( Repository repo , string name )
11
+ : base ( repo )
12
+ {
13
+ this . name = name ;
14
+ }
15
+
16
+ protected override void EvaluateInternal ( Action < SubmoduleSafeHandle > evaluator )
17
+ {
18
+ using ( var handle = Proxy . git_submodule_lookup ( repo . Handle , name ) )
19
+ {
20
+ evaluator ( handle ) ;
21
+ }
22
+ }
23
+ }
24
+ }
Original file line number Diff line number Diff line change 72
72
<Compile Include =" Core\Handles\GitFetchSpecHandle.cs" />
73
73
<Compile Include =" Core\PathCase.cs" />
74
74
<Compile Include =" Core\Handles\SubmoduleSafeHandle.cs" />
75
+ <Compile Include =" Core\SubmoduleLazyGroup.cs" />
75
76
<Compile Include =" Network.cs" />
76
77
<Compile Include =" Core\GitRemoteHead.cs" />
77
78
<Compile Include =" Stash.cs" />
You can’t perform that action at this time.
0 commit comments