11use crate :: { hunk:: VirtualBranchHunk , status:: get_applied_status_cached, VirtualBranchesExt } ;
22use anyhow:: { anyhow, bail, Context , Result } ;
3- use bstr:: BString ;
43use but_rebase:: RebaseStep ;
54use but_workspace:: stack_ext:: StackExt ;
65use gitbutler_branch:: dedup;
@@ -10,8 +9,7 @@ use gitbutler_command_context::CommandContext;
109use gitbutler_commit:: commit_ext:: CommitExt ;
1110use gitbutler_diff:: GitHunk ;
1211use gitbutler_oxidize:: {
13- git2_signature_to_gix_signature, git2_to_gix_object_id, gix_to_git2_oid, GixRepositoryExt ,
14- ObjectIdExt , OidExt ,
12+ git2_to_gix_object_id, gix_to_git2_oid, GixRepositoryExt , ObjectIdExt , OidExt ,
1513} ;
1614use gitbutler_project:: AUTO_TRACK_LIMIT_BYTES ;
1715use gitbutler_reference:: { normalize_branch_name, Refname , RemoteRefname } ;
@@ -66,26 +64,6 @@ impl From<but_workspace::ui::Author> for crate::author::Author {
6664 }
6765}
6866
69- /// The commit-data we can use for comparison to see which remote-commit was used to craete
70- /// a local commit from.
71- /// Note that trees can't be used for comparison as these are typically rebased.
72- #[ derive( Debug , Hash , Eq , PartialEq ) ]
73- pub ( crate ) struct CommitData {
74- message : BString ,
75- author : gix:: actor:: Signature ,
76- }
77-
78- impl TryFrom < & git2:: Commit < ' _ > > for CommitData {
79- type Error = anyhow:: Error ;
80-
81- fn try_from ( commit : & git2:: Commit < ' _ > ) -> std:: result:: Result < Self , Self :: Error > {
82- Ok ( CommitData {
83- message : commit. message_raw_bytes ( ) . into ( ) ,
84- author : git2_signature_to_gix_signature ( commit. author ( ) ) ,
85- } )
86- }
87- }
88-
8967pub fn update_stack ( ctx : & CommandContext , update : & BranchUpdateRequest ) -> Result < Stack > {
9068 let vb_state = ctx. project ( ) . virtual_branches ( ) ;
9169 let mut stack = vb_state. get_stack_in_workspace ( update. id . context ( "BUG(opt-stack-id)" ) ?) ?;
0 commit comments