1
1
use crate :: { hunk:: VirtualBranchHunk , status:: get_applied_status_cached, VirtualBranchesExt } ;
2
2
use anyhow:: { anyhow, bail, Context , Result } ;
3
- use bstr:: BString ;
4
3
use but_rebase:: RebaseStep ;
5
4
use but_workspace:: stack_ext:: StackExt ;
6
5
use gitbutler_branch:: dedup;
@@ -10,8 +9,7 @@ use gitbutler_command_context::CommandContext;
10
9
use gitbutler_commit:: commit_ext:: CommitExt ;
11
10
use gitbutler_diff:: GitHunk ;
12
11
use 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 ,
15
13
} ;
16
14
use gitbutler_project:: AUTO_TRACK_LIMIT_BYTES ;
17
15
use gitbutler_reference:: { normalize_branch_name, Refname , RemoteRefname } ;
@@ -66,26 +64,6 @@ impl From<but_workspace::ui::Author> for crate::author::Author {
66
64
}
67
65
}
68
66
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
-
89
67
pub fn update_stack ( ctx : & CommandContext , update : & BranchUpdateRequest ) -> Result < Stack > {
90
68
let vb_state = ctx. project ( ) . virtual_branches ( ) ;
91
69
let mut stack = vb_state. get_stack_in_workspace ( update. id . context ( "BUG(opt-stack-id)" ) ?) ?;
0 commit comments