@@ -47,7 +47,7 @@ public void CanRebase(string initialBranchName, string branchName, string upstre
47
47
RebaseStepCompleted = x => afterStepCallCount ++ ,
48
48
} ;
49
49
50
- RebaseResult rebaseResult = repo . RebaseOperation . Start ( branch , upstream , onto , Constants . Signature , options ) ;
50
+ RebaseResult rebaseResult = repo . Rebase . Start ( branch , upstream , onto , Constants . Signature , options ) ;
51
51
52
52
// Validation:
53
53
Assert . Equal ( RebaseStatus . Complete , rebaseResult . Status ) ;
@@ -90,7 +90,7 @@ public void CanContinueRebase()
90
90
RebaseStepCompleted = x => afterStepCallCount ++ ,
91
91
} ;
92
92
93
- RebaseResult rebaseResult = repo . RebaseOperation . Start ( branch , upstream , onto , Constants . Signature , options ) ;
93
+ RebaseResult rebaseResult = repo . Rebase . Start ( branch , upstream , onto , Constants . Signature , options ) ;
94
94
95
95
// Verify that we have a conflict.
96
96
Assert . Equal ( CurrentOperation . RebaseMerge , repo . Info . CurrentOperation ) ;
@@ -114,7 +114,7 @@ public void CanContinueRebase()
114
114
115
115
Assert . True ( repo . Index . IsFullyMerged ) ;
116
116
117
- RebaseResult continuedRebaseResult = repo . RebaseOperation . Continue ( Constants . Signature , options ) ;
117
+ RebaseResult continuedRebaseResult = repo . Rebase . Continue ( Constants . Signature , options ) ;
118
118
119
119
Assert . NotNull ( continuedRebaseResult ) ;
120
120
Assert . Equal ( RebaseStatus . Complete , continuedRebaseResult . Status ) ;
@@ -146,7 +146,7 @@ public void CanQueryRebaseOperation()
146
146
Branch upstream = repo . Branches [ conflictBranch1Name ] ;
147
147
Branch onto = repo . Branches [ conflictBranch1Name ] ;
148
148
149
- RebaseResult rebaseResult = repo . RebaseOperation . Start ( branch , upstream , onto , Constants . Signature , null ) ;
149
+ RebaseResult rebaseResult = repo . Rebase . Start ( branch , upstream , onto , Constants . Signature , null ) ;
150
150
151
151
// Verify that we have a conflict.
152
152
Assert . Equal ( RebaseStatus . Conflicts , rebaseResult . Status ) ;
@@ -155,7 +155,7 @@ public void CanQueryRebaseOperation()
155
155
Assert . Equal ( 0 , rebaseRes
10000
ult . CompletedStepCount ) ;
156
156
Assert . Equal ( 3 , rebaseResult . TotalStepCount ) ;
157
157
158
- RebaseStepInfo info = repo . RebaseOperation . GetCurrentStepInfo ( ) ;
158
+ RebaseStepInfo info = repo . Rebase . GetCurrentStepInfo ( ) ;
159
159
Assert . Equal ( 0 , info . StepIndex ) ;
160
160
Assert . Equal ( 3 , info . TotalStepCount ) ;
161
161
Assert . Equal ( RebaseStepOperation . Pick , info . Type ) ;
@@ -178,7 +178,7 @@ public void CanAbortRebase()
178
178
Branch upstream = repo . Branches [ conflictBranch1Name ] ;
179
179
Branch onto = repo . Branches [ conflictBranch1Name ] ;
180
180
181
- RebaseResult rebaseResult = repo . RebaseOperation . Start ( branch , upstream , onto , Constants . Signature , null ) ;
181
+ RebaseResult rebaseResult = repo . Rebase . Start ( branch , upstream , onto , Constants . Signature , null ) ;
182
182
183
183
// Verify that we have a conflict.
184
184
Assert . Equal ( RebaseStatus . Conflicts , rebaseResult . Status ) ;
@@ -187,7 +187,7 @@ public void CanAbortRebase()
187
187
Assert . Equal ( 0 , rebaseResult . CompletedStepCount ) ;
188
188
Assert . Equal ( 3 , rebaseResult . TotalStepCount ) ;
189
189
190
- repo . RebaseOperation . Abort ( Constants . Signature ) ;
190
+ repo . Rebase . Abort ( Constants . Signature ) ;
191
191
Assert . False ( repo . RetrieveStatus ( ) . IsDirty ) ;
192
192
Assert . True ( repo . Index . IsFullyMerged ) ;
193
193
Assert . Equal ( CurrentOperation . None , repo . Info . CurrentOperation ) ;
@@ -210,18 +210,37 @@ public void RebaseWhileAlreadyRebasingThrows()
210
210
Branch upstream = repo . Branches [ conflictBranch1Name ] ;
211
211
Branch onto = repo . Branches [ conflictBranch1Name ] ;
212
212
213
- RebaseResult rebaseResult = repo . RebaseOperation . Start ( branch , upstream , onto , Constants . Signature , null ) ;
213
+ RebaseResult rebaseResult = repo . Rebase . Start ( branch , upstream , onto , Constants . Signature , null ) ;
214
214
215
215
// Verify that we have a conflict.
216
216
Assert . Equal ( RebaseStatus . Conflicts , rebaseResult . Status ) ;
217
217
Assert . True ( repo . RetrieveStatus ( ) . IsDirty ) ;
218
218
Assert . Equal ( CurrentOperation . RebaseMerge , repo . Info . CurrentOperation ) ;
219
219
220
220
Assert . Throws < LibGit2SharpException > ( ( ) =>
221
- repo . RebaseOperation . Start ( branch , upstream , onto , Constants . Signature , null ) ) ;
221
+ repo . Rebase . Start ( branch , upstream , onto , Constants . Signature , null ) ) ;
222
222
}
223
223
}
224
224
225
+ [ Fact ]
226
+ public void RebaseOperationsWithoutRebasingThrow ( )
227
+ {
228
+ SelfCleaningDirectory scd = BuildSelfCleaningDirectory ( ) ;
229
+ var path = Repository . Init ( scd . DirectoryPath ) ;
230
+ using ( Repository repo = new Repository ( path ) )
231
+ {
232
+ ConstructRebaseTestRepository ( repo ) ;
233
+
234
+ repo . Checkout ( topicBranch1Name ) ;
235
+
236
+ Assert . Throws < NotFoundException > ( ( ) =>
237
+ repo . Rebase . Continue ( Constants . Signature , new RebaseOptions ( ) ) ) ;
238
+
239
+ Assert . Throws < NotFoundException > ( ( ) =>
240
+ repo . Rebase . Abort ( Constants . Signature ) ) ;
241
+ }
242
+ }
243
+
225
244
[ Fact ]
226
245
public void CurrentStepInfoIsNullWhenNotRebasing ( )
227
246
{
@@ -232,7 +251,7 @@ public void CurrentStepInfoIsNullWhenNotRebasing()
232
251
ConstructRebaseTestRepository ( repo ) ;
233
252
repo . Checkout ( topicBranch1Name ) ;
234
253
235
- Assert . Null ( repo . RebaseOperation . GetCurrentStepInfo ( ) ) ;
254
+ Assert . Null ( repo . Rebase . GetCurrentStepInfo ( ) ) ;
236
255
}
237
256
}
238
257
0 commit comments