@@ -65,7 +65,7 @@ public void CanRebase(string initialBranchName,
65
65
} ,
66
66
} ;
67
67
68
- RebaseResult rebaseResult = repo . Rebase . Start ( branch , upstream , onto , Constants . Signature , options ) ;
68
+ RebaseResult rebaseResult = repo . Rebase . Start ( branch , upstream , onto , Constants . Identity , options ) ;
69
69
70
70
// Validation:
71
71
Assert . Equal ( RebaseStatus . Complete , rebaseResult . Status ) ;
@@ -114,7 +114,7 @@ public void CanRebaseBranchOntoItself()
114
114
repo . Checkout ( topicBranch2Name ) ;
115
115
Branch b = repo . Branches [ topicBranch2Name ] ;
116
116
117
- RebaseResult result = repo . Rebase . Start ( b , b , null , Constants . Signature , new RebaseOptions ( ) ) ;
117
+ RebaseResult result = repo . Rebase . Start ( b , b , null , Constants . Identity , new RebaseOptions ( ) ) ;
118
118
Assert . Equal ( 0 , result . TotalStepCount ) ;
119
119
Assert . Equal ( RebaseStatus . Complete , result . Status ) ;
120
120
Assert . Equal ( 0 , result . CompletedStepCount ) ;
@@ -229,7 +229,7 @@ public void VerifyRebaseDetailed()
229
229
230
230
} ;
231
231
232
- repo . Rebase . Start ( null , upstreamBranch , null , Constants . Signature2 , options ) ;
232
+ repo . Rebase . Start ( null , upstreamBranch , null , Constants . Identity2 , options ) ;
233
233
234
234
Assert . Equal ( true , wasCheckoutNotifyCalledForResetingHead ) ;
235
235
Assert . Equal ( true , wasCheckoutProgressCalledForResetingHead ) ;
@@ -295,7 +295,7 @@ public void CanContinueRebase()
295
295
CheckoutNotifyFlags = CheckoutNotifyFlags . Updated ,
296
296
} ;
297
297
298
- RebaseResult rebaseResult = repo . Rebase . Start ( branch , upstream , onto , Constants . Signature , options ) ;
298
+ RebaseResult rebaseResult = repo . Rebase . Start ( branch , upstream , onto , Constants . Identity , options ) ;
299
299
300
300
// Verify that we have a conflict.
301
301
Assert . Equal ( CurrentOperation . RebaseMerge , repo . Info . CurrentOperation ) ;
@@ -326,7 +326,7 @@ public void CanContinueRebase()
326
326
327
327
// Clear the flags:
328
328
wasCheckoutProgressCalled = false ; wasCheckoutNotifyCalled = false ;
329
- RebaseResult continuedRebaseResult = repo . Rebase . Continue ( Constants . Signature , options ) ;
329
+ RebaseResult continuedRebaseResult = repo . Rebase . Continue ( Constants . Identity , options ) ;
330
330
331
331
Assert . NotNull ( continuedRebaseResult ) ;
332
332
Assert . Equal ( RebaseStatus . Complete , continuedRebaseResult . Status ) ;
@@ -358,7 +358,7 @@ public void CanQueryRebaseOperation()
358
358
Branch upstream = repo . Branches [ conflictBranch1Name ] ;
359
359
Branch onto = repo . Branches [ conflictBranch1Name ] ;
360
360
361
- RebaseResult rebaseResult = repo . Rebase . Start ( branch , upstream , onto , Constants . Signature , null ) ;
361
+ RebaseResult rebaseResult = repo . Rebase . Start ( branch , upstream , onto , Constants . Identity , null ) ;
362
362
363
363
// Verify that we have a conflict.
364
364
Assert . Equal ( RebaseStatus . Conflicts , rebaseResult . Status ) ;
@@ -390,7 +390,7 @@ public void CanAbortRebase()
390
390
Branch upstream = repo . Branches [ conflictBranch1Name ] ;
391
391
Branch onto = repo . Branches [ conflictBranch1Name ] ;
392
392
393
- RebaseResult rebaseResult = repo . Rebase . Start ( branch , upstream , onto , Constants . Signature , null ) ;
393
+ RebaseResult rebaseResult = repo . Rebase . Start ( branch , upstream , onto , Constants . Identity , null ) ;
394
394
395
395
// Verify that we have a conflict.
396
396
Assert . Equal ( RebaseStatus . Conflicts , rebaseResult . Status ) ;
@@ -436,15 +436,15 @@ public void RebaseWhileAlreadyRebasingThrows()
436
436
Branch upstream = repo . Branches [ conflictBranch1Name ] ;
437
437
Branch onto = repo . Branches [ conflictBranch1Name ] ;
438
438
439
- RebaseResult rebaseResult = repo . Rebase . Start ( branch , upstream , onto , Constants . Signature , null ) ;
439
+ RebaseResult rebaseResult = repo . Rebase . Start ( branch , upstream , onto , Constants . Identity , null ) ;
440
440
441
441
// Verify that we have a conflict.
442
442
Assert . Equal ( RebaseStatus . Conflicts , rebaseResult . Status ) ;
443
443
Assert . True ( repo . RetrieveStatus ( ) . IsDirty ) ;
444
444
Assert . Equal ( CurrentOperation . RebaseMerge , repo . Info . CurrentOperation ) ;
445
445
446
446
Assert . Throws < LibGit2SharpException > ( ( ) =>
447
- repo . Rebase . Start ( branch , upstream , onto , Constants . Signature , null ) ) ;
447
+ repo . Rebase . Start ( branch , upstream , onto , Constants . Identity , null ) ) ;
448
448
}
449
449
}
450
450
@@ -460,7 +460,7 @@ public void RebaseOperationsWithoutRebasingThrow()
460
460
repo . Checkout ( topicBranch1Name ) ;
461
461
462
462
Assert . Throws < NotFoundException > ( ( ) =>
463
- repo . Rebase . Continue ( Constants . Signature , new RebaseOptions ( ) ) ) ;
463
+ repo . Rebase . Continue ( Constants . Identity , new RebaseOptions ( ) ) ) ;
464
464
465
465
Assert . Throws < NotFoundException > ( ( ) =>
466
466
repo . Rebase . Abort ( ) ) ;
@@ -520,15 +520,22 @@ public void CanRebaseHandlePatchAlreadyApplied()
520
520
}
521
521
} ;
522
522
523
- repo . Rebase . Start ( null , upstreamBranch , null , Constants . Signature2 , options ) ;
523
+ repo . Rebase . Start ( null , upstreamBranch , null , Constants . Identity2 , options ) ;
524
+ ObjectId secondCommitExpectedTreeId = new ObjectId ( "ac04bf04980c9be72f64ba77fd0d9088a40ed681" ) ;
525
+ Signature secondCommitAuthorSignature = Constants . Signature ;
526
+ Identity secondCommitCommiterIdentity = Constants . Identity2 ;
524
527
525
- List < CompletedRebaseStepInfo > expectedRebaseResults = new List < CompletedRebaseStepInfo > ( )
526
- {
527
- new CompletedRebaseStepInfo ( null , true ) ,
528
- new CompletedRebaseStepInfo ( repo . Lookup < Commit > ( "ebdea37ecf583fb7fa5c806a1c00b82f3987fbaa" ) , false ) ,
529
- } ;
528
+ Assert . Equal ( 2 , rebaseResults . Count ) ;
529
+ Assert . True ( rebaseResults [ 0 ] . WasPatchAlreadyApplied ) ;
530
+
531
+ Assert . False ( rebaseResults [ 1 ] . WasPatchAlreadyApplied ) ;
532
+ Assert . NotNull ( rebaseResults [ 1 ] . Commit ) ;
530
533
531
- Assert . Equal < CompletedRebaseStepInfo > ( expectedRebaseResults , rebaseResults , new CompletedRebaseStepInfoEqualityComparer ( ) ) ;
534
+ // This is the expected tree ID of the new commit.
535
+ Assert . True ( ObjectId . Equals ( secondCommitExpectedTreeId , rebaseResults [ 1 ] . Commit . Tree . Id ) ) ;
536
+ Assert . True ( Signature . Equals ( secondCommitAuthorSignature , rebaseResults [ 1 ] . Commit . Author ) ) ;
537
+ Assert . Equal < string > ( secondCommitCommiterIdentity . Name , rebaseResults [ 1 ] . Commit . Committer . Name , StringComparer . Ordinal ) ;
538
+ Assert . Equal < string > ( secondCommitCommiterIdentity . Email , rebaseResults [ 1 ] . Commit . Committer . Email , StringComparer . Ordinal ) ;
532
539
}
533
540
}
534
541
0 commit comments