This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -386,17 +386,6 @@ public async Task<string> GetPullRequestMergeBase(IRepository repo,
386386 Guard . ArgumentNotNull ( targetCloneUrl , nameof ( targetCloneUrl ) ) ;
387387 Guard . ArgumentNotEmptyString ( baseRef , nameof ( baseRef ) ) ;
388388
389- var baseCommit = repo . Lookup < Commit > ( baseSha ) ;
390- if ( baseCommit == null )
391- {
392- await Fetch ( repo , targetCloneUrl , baseRef ) ;
393- baseCommit = repo . Lookup < Commit > ( baseSha ) ;
394- if ( baseCommit == null )
395- {
396- throw new NotFoundException ( $ "Couldn't find { baseSha } after fetching from { targetCloneUrl } :{ baseRef } .") ;
397- }
398- }
399-
400389 var headCommit = repo . Lookup < Commit > ( headSha ) ;
401390 if ( headCommit == null )
402391 {
@@ -409,6 +398,17 @@ public async Task<string> GetPullRequestMergeBase(IRepository repo,
409398 }
410399 }
411400
401+ var baseCommit = repo . Lookup < Commit > ( baseSha ) ;
402+ if ( baseCommit == null )
403+ {
404+ await Fetch ( repo , targetCloneUrl , baseRef ) ;
405+ baseCommit = repo . Lookup < Commit > ( baseSha ) ;
406+ if ( baseCommit == null )
407+ {
408+ throw new NotFoundException ( $ "Couldn't find { baseSha } after fetching from { targetCloneUrl } :{ baseRef } .") ;
409+ }
410+ }
411+
412412 var mergeBaseCommit = repo . ObjectDatabase . FindMergeBase ( baseCommit , headCommit ) ;
413413 if ( mergeBaseCommit == null )
414414 {
You can’t perform that action at this time.
0 commit comments