Merge pull request #5512 from gitbutlerapp/kv-branch-1

Make pr numbers available for branch listing
This commit is contained in:
Kiril Videlov 2024-11-11 00:16:47 +01:00 committed by GitHub
commit aa28ade188
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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