File tree Expand file tree Collapse file tree 2 files changed +12
-27
lines changed Expand file tree Collapse file tree 2 files changed +12
-27
lines changed Original file line number Diff line number Diff line change @@ -228,18 +228,14 @@ public interface IRepository : IDisposable
228
228
229
229
/// <summary>
230
230
/// Analyze the possibilities of updating HEAD with the given commit(s).
231
+ /// <para>
232
+ /// It expects objects convertible to annotated commits, so <see cref="LibGit2Sharp.Reference"/> and
233
+ /// <see cref="LibGit2Sharp.Commit"/> also work as inputs.
234
+ /// </para>
231
235
/// </summary>
232
236
/// <param name="commits">Commits to merge into HEAD</param>
233
237
/// <returns>Which update methods are possible and which preference the user has specified</returns>
234
- MergeAnalysisResult AnalyzeMerge ( params Commit [ ] commits ) ;
235
-
236
-
237
- /// <summary>
238
- /// Analyze the possibilities of updating HEAD with the given reference(s)
239
- /// </summary>
240
- /// <param name="references">References to merge into HEAD</param>
241
- /// <returns>Which update methods are possible and which preference the user has specified</returns>
242
- MergeAnalysisResult AnalyzeMerge ( params Reference [ ] references ) ;
238
+ MergeAnalysisResult AnalyzeMerge ( params IAnnotatedCommit [ ] commits ) ;
243
239
244
240
/// <summary>
245
241
/// Access to Rebase functionality.
Original file line number Diff line number Diff line change @@ -1423,29 +1423,18 @@ private MergeAnalysisResult AnalyzeMerge(AnnotatedCommitHandle[] annotatedCommit
1423
1423
1424
1424
/// <summary>
1425
1425
/// Analyze the possibilities of updating HEAD with the given commit(s).
1426
+ /// <para>
1427
+ /// It expects objects convertible to annotated commits, so <see cref="LibGit2Sharp.Reference"/> and
1428
+ /// <see cref="LibGit2Sharp.Commit"/> also work as inputs.
1429
+ /// </para>
1426
1430
/// </summary>
1427
1431
/// <param name="commits">Commits to merge into HEAD</param>
1428
1432
/// <returns>Which update methods are possible and which preference the user has specified</returns>
1429
- public MergeAnalysisResult AnalyzeMerge ( params Commit [ ] commits )
1430
- {
1431
- using ( var handles = new DisposableArray < AnnotatedCommitHandle > ( commits . Select ( commit =>
1432
- Proxy . git_annotated_commit_lookup ( Handle , commit . Id . Oid ) ) . ToArray ( ) ) )
1433
- {
1434
- return AnalyzeMerge ( handles ) ;
1435
- }
1436
- }
1437
-
1438
- /// <summary>
1439
- /// Analyze the possibilities of updating HEAD with the given reference(s)
1440
- /// </summary>
1441
- /// <param name="references">References to merge into HEAD</param>
1442
- /// <returns>Which update methods are possible and which preference the user has specified</returns>
1443
- public MergeAnalysisResult AnalyzeMerge ( params Reference [ ] references )
1433
+ public MergeAnalysisResult AnalyzeMerge ( params IAnnotatedCommit [ ] commits )
1444
1434
{
1445
- using ( var refHandles = new DisposableArray < ReferenceHandle > ( references . Select ( r => refs . RetrieveReferencePtr ( r . CanonicalName ) ) ) )
1446
- using ( var handles = new DisposableArray < AnnotatedCommitHandle > ( refHandles . Array . Select ( rh => Proxy . git_annotated_commit_from_ref ( Handle , rh ) ) ) )
1435
+ using ( var annotated = new DisposableArray < AnnotatedCommit > ( commits . Select ( c => c . GetAnnotatedCommit ( ) ) ) )
1447
1436
{
1448
- return AnalyzeMerge ( handles ) ;
1437
+ return AnalyzeMerge ( annotated . Array . Select ( c => c . Handle ) . ToArray ( ) ) ;
1449
1438
}
1450
1439
}
1451
1440
You can’t perform that action at this time.
0 commit comments