1- using LibGit2Sharp . Core ;
2- using LibGit2Sharp . Core . Handles ;
3- using System ;
1+ using System ;
42using System . Collections ;
53using System . Collections . Generic ;
64using System . Globalization ;
7- using System . IO ;
85using System . Linq ;
9- using System . Text ;
6+ using LibGit2Sharp . Core ;
7+ using LibGit2Sharp . Core . Handles ;
108
119namespace LibGit2Sharp
1210{
@@ -48,7 +46,7 @@ public virtual Worktree this[string name]
4846 }
4947
5048 /// <summary>
51- ///
49+ ///
5250 /// </summary>
5351 /// <param name="committishOrBranchSpec"></param>
5452 /// <param name="name"></param>
@@ -57,7 +55,7 @@ public virtual Worktree this[string name]
5755 /// <returns></returns>
5856 public virtual Worktree Add ( string committishOrBranchSpec , string name , string path , bool isLocked )
5957 {
60- if ( string . Equals ( committishOrBranchSpec , name ) )
58+ if ( string . Equals ( committishOrBranchSpec , name ) )
6159 {
6260 // Proxy.git_worktree_add() creates a new branch of name = name, so if we want to checkout a given branch then the 'name' cannot be the same as the target branch
6361 return null ;
@@ -66,7 +64,8 @@ public virtual Worktree Add(string committishOrBranchSpec, string name, string p
6664 git_worktree_add_options options = new git_worktree_add_options
6765 {
6866 version = 1 ,
69- locked = Convert . ToInt32 ( isLocked )
67+ locked = Convert . ToInt32 ( isLocked ) ,
68+ checkout_options = new GitCheckoutOpts { version = 1 }
7069 } ;
7170
7271 using ( var handle = Proxy . git_worktree_add ( repo . Handle , name , path , options ) )
@@ -83,13 +82,13 @@ public virtual Worktree Add(string committishOrBranchSpec, string name, string p
8382 }
8483 }
8584
86-
8785
88- return this [ name ] ;
86+
87+ return this [ name ] ;
8988 }
9089
9190 /// <summary>
92- ///
91+ ///
9392 /// </summary>
9493 /// <param name="name"></param>
9594 /// <param name="path"></param>
@@ -99,7 +98,8 @@ public virtual Worktree Add(string name, string path, bool isLocked)
9998 git_worktree_add_options options = new git_worktree_add_options
10099 {
101100 version = 1 ,
102- locked = Convert . ToInt32 ( isLocked )
101+ locked = Convert . ToInt32 ( isLocked ) ,
102+ checkout_options = new GitCheckoutOpts { version = 1 }
103103 } ;
104104
105105 using ( var handle = Proxy . git_worktree_add ( repo . Handle , name , path , options ) )
@@ -112,7 +112,7 @@ public virtual Worktree Add(string name, string path, bool isLocked)
112112 }
113113
114114 /// <summary>
115- ///
115+ ///
116116 /// </summary>
117117 /// <param name="worktree"></param>
118118 /// <returns></returns>
@@ -122,7 +122,7 @@ public virtual bool Prune(Worktree worktree)
122122 }
123123
124124 /// <summary>
125- ///
125+ ///
126126 /// </summary>
127127 /// <param name="worktree"></param>
128128 /// <param name="ifLocked"></param>
0 commit comments