File tree Expand file tree Collapse file tree 5 files changed +397
-71
lines changed Expand file tree Collapse file tree 5 files changed +397
-71
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,26 @@ fn ref_metadata_toml(project: &Project) -> anyhow::Result<VirtualBranchesTomlMet
25
25
VirtualBranchesTomlMetadata :: from_path ( project. gb_dir ( ) . join ( "virtual_branches.toml" ) )
26
26
}
27
27
28
+ #[ api_cmd]
29
+ #[ tauri:: command( async ) ]
30
+ #[ instrument( err( Debug ) ) ]
31
+ pub fn head_info ( project_id : ProjectId ) -> Result < but_workspace:: ref_info:: ui:: RefInfo , Error > {
32
+ let project = gitbutler_project:: get ( project_id) ?;
33
+ let ctx = CommandContext :: open ( & project, AppSettings :: load_from_default_path_creating ( ) ?) ?;
34
+ let repo = ctx. gix_repo_for_merging_non_persisting ( ) ?;
35
+ let meta = ref_metadata_toml ( ctx. project ( ) ) ?;
36
+ but_workspace:: head_info (
37
+ & repo,
38
+ & meta,
39
+ but_workspace:: ref_info:: Options {
40
+ traversal : but_graph:: init:: Options :: limited ( ) ,
41
+ expensive_commit_info : true ,
42
+ } ,
43
+ )
44
+ . map_err ( Into :: into)
45
+ . and_then ( |info| but_workspace:: ref_info:: ui:: RefInfo :: for_ui ( info, & repo) . map_err ( Into :: into) )
46
+ }
47
+
28
48
#[ api_cmd]
29
49
#[ tauri:: command( async ) ]
30
50
#[ instrument( err( Debug ) ) ]
Original file line number Diff line number Diff line change @@ -431,7 +431,7 @@ pub struct Stack {
431
431
pub base : Option < gix:: ObjectId > ,
432
432
/// The branch-name denoted segments of the stack from its tip to the point of reference, typically a merge-base.
433
433
/// This array is never empty.
434
- pub segments : Vec < ref_info:: ui :: Segment > ,
434
+ pub segments : Vec < ref_info:: Segment > ,
435
435
}
436
436
437
437
impl Stack {
You can’t perform that action at this time.
0 commit comments