File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -48,17 +48,14 @@ pub(super) fn command() -> clap::Command {
48
48
}
49
49
50
50
pub ( super ) fn dispatch ( repo : & gix:: Repository , matches : & clap:: ArgMatches ) -> Result < ( ) > {
51
- let ( target_branch, target_branchname) = if let Some ( branch_loc) = matches. get_one :: < BranchLocator > ( "branch-any" ) {
52
- let branch = branch_loc. resolve ( repo) ?;
53
- let branchname = branch. get_branch_partial_name ( ) ?;
54
- ( branch, branchname)
51
+ let target_branch = if let Some ( branch_loc) = matches. get_one :: < BranchLocator > ( "branch-any" ) {
52
+ branch_loc. resolve ( repo) ?
55
53
} else if let Ok ( branch) = repo. get_current_branch ( ) {
56
- let branchname = branch. get_branch_partial_name ( ) ?;
57
- ( branch, branchname)
54
+ branch
58
55
} else {
59
56
return Err ( anyhow ! ( "no target branch specified and no current branch" ) ) ;
60
57
} ;
61
-
58
+ let target_branchname = target_branch . get_branch_partial_name ( ) ? ;
62
59
let current_branch = repo. get_current_branch ( ) . ok ( ) ;
63
60
let current_branchname = current_branch
64
61
. as_ref ( )
Original file line number Diff line number Diff line change @@ -91,8 +91,12 @@ impl<'repo> Stack<'repo> {
91
91
// It is ok if the StGit-specific config section does not exist.
92
92
let mut local_config_file = repo. local_config_file ( ) ?;
93
93
let section = format ! ( "{branch_name}.stgit" ) ;
94
- if local_config_file. remove_section ( "branch" , Some ( section. as_bytes ( ) . into ( ) ) ) . is_some ( ) {
95
- repo. write_local_config ( local_config_file) . context ( "writing local config" ) ?;
94
+ if local_config_file
95
+ . remove_section ( "branch" , Some ( section. as_bytes ( ) . into ( ) ) )
96
+ . is_some ( )
97
+ {
98
+ repo. write_local_config ( local_config_file)
99
+ . context ( "writing local config" ) ?;
96
100
}
97
101
98
102
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments