File tree Expand file tree Collapse file tree 1 file changed +4
-15
lines changed
src/DemaConsulting.BuildMark/RepoConnectors Expand file tree Collapse file tree 1 file changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -80,21 +80,10 @@ public override async Task<BuildInformation> GetBuildInformationAsync(Version? v
8080
8181 // Build a mapping from commit SHA to pull request.
8282 // This is used to associate commits with their pull requests for change tracking.
83- // Include both merged PRs (via MergeCommitSha) and open PRs (via head SHA).
84- var commitHashToPr = new Dictionary < string , PullRequest > ( ) ;
85- foreach ( var pr in pullRequests )
86- {
87- if ( pr . Merged && pr . MergeCommitSha != null )
88- {
89- // Add merged PR by its merge commit SHA
90- commitHashToPr . TryAdd ( pr . MergeCommitSha , pr ) ;
91- }
92- else if ( pr . State == ItemState . Open && pr . Head ? . Sha != null )
93- {
94- // Add open PR by its head commit SHA
95- commitHashToPr . TryAdd ( pr . Head . Sha , pr ) ;
96- }
97- }
83+ // For merged PRs, use MergeCommitSha; for open PRs, use head SHA.
84+ var commitHashToPr = pullRequests
85+ . Where ( p => ( p . Merged && p . MergeCommitSha != null ) || ( ! p . Merged && p . Head ? . Sha != null ) )
86+ . ToDictionary ( p => p . Merged ? p . MergeCommitSha ! : p . Head . Sha , p => p ) ;
9887
9988 // Build a set of commit SHAs in the current branch.
10089 // This is used for efficient filtering of branch-related tags.
You can’t perform that action at this time.
0 commit comments