@@ -10,15 +10,15 @@ use gitbutler_repo::{LogUntil, RepoActionsExt, RepositoryExt};
1010use gitbutler_serde:: BStringForFrontend ;
1111use serde:: Serialize ;
1212
13- // this struct is a mapping to the view `RemoteBranch` type in Typescript
14- // found in src-tauri/src/routes/repo/[project_id]/types.ts
15- //
16- // it holds data calculated for presentation purposes of one Git branch
17- // with comparison data to the Target commit, determining if it is mergeable,
18- // and how far ahead or behind the Target it is.
19- // an array of them can be requested from the frontend to show in the sidebar
20- // Tray and should only contain branches that have not been converted into
21- // virtual branches yet (ie, we have no `Branch` struct persisted in our data.
13+ /// this struct is a mapping to the view `RemoteBranch` type in Typescript
14+ /// found in src-tauri/src/routes/repo/[project_id]/types.ts
15+ ///
16+ /// it holds data calculated for presentation purposes of one Git branch
17+ /// with comparison data to the Target commit, determining if it is mergeable,
18+ /// and how far ahead or behind the Target it is.
19+ /// an array of them can be requested from the frontend to show in the sidebar
20+ /// Tray and should only contain branches that have not been converted into
21+ /// virtual branches yet (ie, we have no `Branch` struct persisted in our data.
2222#[ derive( Debug , Clone , Serialize , PartialEq ) ]
2323#[ serde( rename_all = "camelCase" ) ]
2424pub struct RemoteBranch {
@@ -57,9 +57,14 @@ pub struct RemoteCommit {
5757 pub parent_ids : Vec < git2:: Oid > ,
5858}
5959
60- // for legacy purposes, this is still named "remote" branches, but it's actually
61- // a list of all the normal (non-gitbutler) git branches.
62- pub fn list_remote_branches ( ctx : & CommandContext ) -> Result < Vec < RemoteBranch > > {
60+ /// Return information on all local branches, while skipping gitbutler-specific branches in `refs/heads`.
61+ ///
62+ /// Note to be confused with `list_branches()`, which is used for the new branch listing.
63+ ///
64+ /// # Previous notes
65+ /// For legacy purposes, this is still named "remote" branches, but it's actually
66+ /// a list of all the normal (non-gitbutler) git branches.
67+ pub fn list_local_branches ( ctx : & CommandContext ) -> Result < Vec < RemoteBranch > > {
6368 let default_target = default_target ( & ctx. project ( ) . gb_dir ( ) ) ?;
6469
6570 let mut remote_branches = vec ! [ ] ;
0 commit comments