@@ -50,7 +50,7 @@ public void CanRebase(string initialBranchName,
50
50
int beforeStepCallCount = 0 ;
51
51
int afterStepCallCount = 0 ;
52
52
53
- List < ObjectId > PreRebaseCommits = new List < ObjectId > ( ) ;
53
+ List < Commit > PreRebaseCommits = new List < Commit > ( ) ;
54
54
List < CompletedRebaseStepInfo > PostRebaseResults = new List < CompletedRebaseStepInfo > ( ) ;
55
55
ObjectId expectedParentId = upstream . Tip . Id ;
56
56
@@ -59,12 +59,12 @@ public void CanRebase(string initialBranchName,
59
59
RebaseStepStarting = x =>
60
60
{
61
61
beforeStepCallCount ++ ;
62
- PreRebaseCommits . Add ( x . StepInfo . ID ) ;
62
+ PreRebaseCommits . Add ( x . StepInfo . Commit ) ;
63
63
} ,
64
64
RebaseStepCompleted = x =>
65
65
{
66
66
afterStepCallCount ++ ;
67
- PostRebaseResults . Add ( new CompletedRebaseStepInfo ( x . CommitId , x . WasPatchAlreadyApplied ) ) ;
67
+ PostRebaseResults . Add ( new CompletedRebaseStepInfo ( x . Commit , x . WasPatchAlreadyApplied ) ) ;
68
68
} ,
69
69
} ;
70
70
@@ -88,31 +88,31 @@ public void CanRebase(string initialBranchName,
88
88
Until = expectedUntilCommit ,
89
89
SortBy = CommitSortStrategies . Reverse | CommitSortStrategies . Topological ,
90
90
} ;
91
- Assert . Equal ( repo . Commits . QueryBy ( sourceCommitFilter ) . Select ( c => c . Id ) , PreRebaseCommits ) ;
91
+ Assert . Equal ( repo . Commits . QueryBy ( sourceCommitFilter ) , PreRebaseCommits ) ;
92
92
93
93
// Verify the chain of commits that resulted from the rebase.
94
94
Commit expectedParent = expectedOntoCommit ;
95
95
foreach ( CompletedRebaseStepInfo stepInfo in PostRebaseResults )
96
96
{
97
- Commit rebasedCommit = repo . Lookup < Commit > ( stepInfo . ObjectId ) ;
97
+ Commit rebasedCommit = stepInfo . Commit ;
98
98
Assert . Equal ( expectedParent . Id , rebasedCommit . Parents . First ( ) . Id ) ;
99
99
Assert . False ( stepInfo . WasPatchAlreadyApplied ) ;
100
100
expectedParent = rebasedCommit ;
101
101
}
102
102
103
- Assert . Equal ( repo . Head . Tip . Id , PostRebaseResults . Last ( ) . ObjectId ) ;
103
+ Assert . Equal ( repo . Head . Tip , PostRebaseResults . Last ( ) . Commit ) ;
104
104
}
105
105
}
106
106
107
107
private class CompletedRebaseStepInfo
108
108
{
109
- public CompletedRebaseStepInfo ( ObjectId objectId , bool wasPatchAlreadyApplied )
109
+ public CompletedRebaseStepInfo ( Commit commit , bool wasPatchAlreadyApplied )
110
110
{
111
- ObjectId = objectId ;
111
+ Commit = commit ;
112
112
WasPatchAlreadyApplied = wasPatchAlreadyApplied ;
113
113
}
114
114
115
- public ObjectId ObjectId { get ; set ; }
115
+ public Commit Commit { get ; set ; }
116
116
117
117
public bool WasPatchAlreadyApplied { get ; set ; }
118
118
}
@@ -133,16 +133,16 @@ bool IEqualityComparer<CompletedRebaseStepInfo>.Equals(CompletedRebaseStepInfo x
133
133
}
134
134
135
135
return x . WasPatchAlreadyApplied == y . WasPatchAlreadyApplied &&
136
- ObjectId . Equals ( x . ObjectId , y . ObjectId ) ;
136
+ ObjectId . Equals ( x . Commit , y . Commit ) ;
137
137
}
138
138
139
139
int IEqualityComparer < CompletedRebaseStepInfo > . GetHashCode ( CompletedRebaseStepInfo obj )
140
140
{
141
141
int hashCode = obj . WasPatchAlreadyApplied . GetHashCode ( ) ;
142
142
143
- if ( obj . ObjectId != null )
143
+ if ( obj . Commit != null )
144
144
{
145
- hashCode += obj . ObjectId . GetHashCode ( ) ;
145
+ hashCode += obj . Commit . GetHashCode ( ) ;
146
146
}
147
147
148
148
return hashCode ;
@@ -449,7 +449,7 @@ public void CanRebaseHandlePatchAlreadyApplied()
449
449
{
450
450
RebaseStepCompleted = x =>
451
451
{
452
- rebaseResults . Add ( new CompletedRebaseStepInfo ( x . CommitId , x . WasPatchAlreadyApplied ) ) ;
452
+ rebaseResults . Add ( new CompletedRebaseStepInfo ( x . Commit , x . WasPatchAlreadyApplied ) ) ;
453
453
}
454
454
} ;
455
455
@@ -458,7 +458,7 @@ public void CanRebaseHandlePatchAlreadyApplied()
458
458
List < CompletedRebaseStepInfo > expectedRebaseResults = new List < CompletedRebaseStepInfo > ( )
459
459
{
460
460
new CompletedRebaseStepInfo ( null , true ) ,
461
- new CompletedRebaseStepInfo ( new ObjectId ( "ebdea37ecf583fb7fa5c806a1c00b82f3987fbaa" ) , false ) ,
461
+ new CompletedRebaseStepInfo ( repo . Lookup < Commit > ( "ebdea37ecf583fb7fa5c806a1c00b82f3987fbaa" ) , false ) ,
462
462
} ;
463
463
464
464
Assert . Equal < CompletedRebaseStepInfo > ( expectedRebaseResults , rebaseResults , new CompletedRebaseStepInfoEqualityComparer ( ) ) ;
0 commit comments