Make pr numbers available for branch listing

This commit is contained in:
Kiril Videlov 2024-11-10 22:36:46 +01:00
parent 04655cda39
commit 3546c9e5a2
2 changed files with 9 additions and 0 deletions

View File

@ -364,6 +364,8 @@ export class VirtualBranchReference {
Ordered from newest to oldest (the most recent branch is first in the list)
*/
stackBranches!: string[];
/** Pull Request numbes by branch name associated with the stack */
pullRequests!: Map<string, number>;
}
/** Represents a "commit author" or "signature", based on the data from ther git history */

View File

@ -274,6 +274,11 @@ fn branch_group_to_branch(
.rev()
.map(|b| b.name.clone())
.collect_vec(),
pull_requests: stack
.branches()
.iter()
.filter_map(|b| b.pr_number.map(|pr| (b.name.clone(), pr)))
.collect(),
});
let mut remotes: Vec<gix::remote::Name<'static>> = Vec::new();
@ -502,6 +507,8 @@ pub struct VirtualBranchReference {
/// List of branches that are part of the stack
/// Ordered from newest to oldest (the most recent branch is first in the list)
pub stack_branches: Vec<String>,
/// Pull Request numbes by branch name associated with the stack
pub pull_requests: HashMap<String, usize>,
}
/// Takes a list of `branch_names` (the given name, as returned by `BranchListing`) and returns