File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ enum Changes {
13
13
}
14
14
15
15
pub fn instafix (
16
- _squash : bool ,
16
+ squash : bool ,
17
17
max_commits : usize ,
18
18
message_pattern : Option < String > ,
19
19
upstream_branch_name : Option < & str > ,
@@ -26,7 +26,7 @@ pub fn instafix(
26
26
let upstream = get_upstream ( & repo, & head_branch, upstream_branch_name) ?;
27
27
let commit_to_amend = select_commit_to_amend ( & repo, upstream, max_commits, & message_pattern) ?;
28
28
eprintln ! ( "Selected {}" , disp( & commit_to_amend) ) ;
29
- do_fixup_commit ( & repo, & head_branch, & commit_to_amend, false ) ?;
29
+ do_fixup_commit ( & repo, & head_branch, & commit_to_amend, squash ) ?;
30
30
let current_branch = Branch :: wrap ( repo. head ( ) ?) ;
31
31
do_rebase ( & repo, & current_branch, & commit_to_amend, & diff) ?;
32
32
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ When run with no arguments this will:
38
38
max_term_width = 100
39
39
) ]
40
40
struct Args {
41
- /// Use `squash!`: change the commit message that you amend
41
+ /// Change the commit message that you amend, instead of using the original commit message
42
42
#[ clap( short = 's' , long = "squash" ) ]
43
43
squash : bool ,
44
44
/// The maximum number of commits to show when looking for your merge point
@@ -59,6 +59,7 @@ struct Args {
59
59
60
60
fn main ( ) {
61
61
let mut args = Args :: parse ( ) ;
62
+ // if called as git squash set the squash flag to true
62
63
if env:: args ( ) . next ( ) . unwrap ( ) . ends_with ( "squash" ) {
63
64
args. squash = true
64
65
}
You can’t perform that action at this time.
0 commit comments