File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
ModularPipelines.Git/Options Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 1+ - GitCheckoutOptions now has a constructor to create a new branch with the ` -b ` flag
Original file line number Diff line number Diff line change @@ -5,8 +5,24 @@ namespace ModularPipelines.Git.Options;
55
66[ CommandPrecedingArguments ( "checkout" ) ]
77[ ExcludeFromCodeCoverage ]
8- public record GitCheckoutOptions ( [ property : PositionalArgument ] string BranchName ) : GitOptions
8+ public record GitCheckoutOptions : GitOptions
99{
10+ public GitCheckoutOptions ( string branchName ) : this ( branchName , false )
11+ {
12+ }
13+
14+ public GitCheckoutOptions ( string branchName , bool create )
15+ {
16+ if ( create )
17+ {
18+ NewBranchName = branchName ;
19+ }
20+ else
21+ {
22+ BranchName = branchName ;
23+ }
24+ }
25+
1026 [ BooleanCommandSwitch ( "--quiet" ) ]
1127 public bool ? Quiet { get ; set ; }
1228
@@ -81,4 +97,10 @@ public record GitCheckoutOptions([property: PositionalArgument] string BranchNam
8197
8298 [ BooleanCommandSwitch ( "--pathspec-file-nul" ) ]
8399 public bool ? PathspecFileNul { get ; set ; }
100+
101+ [ PositionalArgument ]
102+ public string ? BranchName { get ; set ; }
103+
104+ [ CommandEqualsSeparatorSwitch ( "-b" ) ]
105+ public string ? NewBranchName { get ; set ; }
84106}
You can’t perform that action at this time.
0 commit comments