File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ pub struct RenameBranchParams {
11
11
pub commit_message : String ,
12
12
pub stack_id : StackId ,
13
13
pub current_branch_name : String ,
14
- pub existing_branch_names : Vec < String > ,
15
14
}
16
15
17
16
pub async fn rename_branch (
@@ -25,10 +24,14 @@ pub async fn rename_branch(
25
24
commit_message,
26
25
stack_id,
27
26
current_branch_name,
28
- existing_branch_names,
29
27
} = parameters;
30
28
31
29
let repo = & ctx. gix_repo_for_merging_non_persisting ( ) ?;
30
+ let stacks = crate :: stacks ( ctx, repo) ?;
31
+ let existing_branch_names = stacks
32
+ . iter ( )
33
+ . flat_map ( |s| s. heads . iter ( ) . map ( |h| h. name . clone ( ) . to_string ( ) ) )
34
+ . collect :: < Vec < _ > > ( ) ;
32
35
let changes = but_core:: diff:: ui:: commit_changes_by_worktree_dir ( repo, commit_id) ?;
33
36
let diff = changes. try_as_unidiff_string ( repo, ctx. app_settings ( ) . context_lines ) ?;
34
37
let diffs = vec ! [ diff] ;
Original file line number Diff line number Diff line change @@ -112,10 +112,6 @@ pub(crate) async fn handle_stop() -> anyhow::Result<ClaudeHookOutput> {
112
112
) ?;
113
113
114
114
let stacks = crate :: log:: stacks ( defer. ctx ) ?;
115
- let existing_branch_names = stacks
116
- . iter ( )
117
- . flat_map ( |s| s. heads . iter ( ) . map ( |h| h. name . clone ( ) . to_string ( ) ) )
118
- . collect :: < Vec < _ > > ( ) ;
119
115
120
116
// Trigger commit message generation for newly created commits
121
117
// TODO: Maybe this can be done in the main app process i.e. the GitButler GUI, if avaialbe
@@ -162,7 +158,6 @@ pub(crate) async fn handle_stop() -> anyhow::Result<ClaudeHookOutput> {
162
158
commit_message,
163
159
stack_id : branch. stack_id ,
164
160
current_branch_name : branch. branch_name . clone ( ) ,
165
- existing_branch_names : existing_branch_names. clone ( ) ,
166
161
} ;
167
162
but_action:: rename_branch:: rename_branch (
168
163
defer. ctx ,
You can’t perform that action at this time.
0 commit comments