File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -36,13 +36,21 @@ public static GitRepositoryInitOptions BuildFrom(InitOptions initOptions)
36
36
opts . Flags |= GitRepositoryInitFlags . GIT_REPOSITORY_INIT_BARE ;
37
37
}
38
38
39
+ if ( initOptions . InitialHead != null )
40
+ {
41
+ opts . InitialHead = StrictUtf8Marshaler . FromManaged ( initOptions . InitialHead ) ;
42
+ }
43
+
39
44
return opts ;
40
45
}
41
46
42
47
public void Dispose ( )
43
48
{
44
49
EncodingMarshaler . Cleanup ( WorkDirPath ) ;
45
50
WorkDirPath = IntPtr . Zero ;
51
+
52
+ EncodingMarshaler . Cleanup ( InitialHead ) ;
53
+ InitialHead = IntPtr . Zero ;
46
54
}
47
55
}
48
56
Original file line number Diff line number Diff line change @@ -11,12 +11,14 @@ public sealed class InitOptions
11
11
/// Default behavior:
12
12
/// The workdirPath is null.
13
13
/// Not a bare repository.
14
+ /// Default initial head.
14
15
/// </para>
15
16
/// </summary>
16
17
public InitOptions ( )
17
18
{
18
19
WorkdirPath = null ;
19
20
IsBare = false ;
21
+ InitialHead = null ;
20
22
}
21
23
22
24
/// <summary>
@@ -28,5 +30,12 @@ public InitOptions()
28
30
/// True to initialize a bare repository. False otherwise, to initialize a standard ".git" repository.
29
31
/// </summary>
30
32
public bool IsBare { get ; set ; }
33
+
34
+ /// <summary>
35
+ /// The name of the head to point HEAD at.
36
+ /// If null, then this will be treated as "master" and the HEAD ref will be set to "refs/heads/master".
37
+ /// If this begins with "refs/" it will be used verbatim; otherwise "refs/heads/" will be prefixed.
38
+ /// </summary>
39
+ public string InitialHead { get ; set ; }
31
40
}
32
41
}
You can’t perform that action at this time.
0 commit comments