This repository was archived by the owner on Aug 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ pub(crate) enum Commands {
3939 #[ arg( long, default_value_t = false ) ]
4040 no_verify : bool ,
4141 /// Optional flag for an issue reference.
42- #[ arg( long, default_value_t = false ) ]
43- issue : bool ,
42+ #[ arg( long) ]
43+ issue : Option < String > ,
4444 } ,
4545}
Original file line number Diff line number Diff line change @@ -60,6 +60,9 @@ fn main() -> anyhow::Result<()> {
6060 let scope_part = scope. map_or ( "" . to_string ( ) , |s| format ! ( "({})" , s) ) ;
6161 let header = format ! ( "{}{}: {}" , r#type, scope_part, message) ;
6262 let mut commit_message = format ! ( "{}" , header) ;
63+ if let Some ( issue_ref) = & issue {
64+ commit_message = format ! ( "{} {}" , issue_ref, commit_message) ;
65+ }
6366
6467 if !no_verify {
6568 let checked = run_checklist_interactive ( & config. checklist ) ?;
@@ -75,7 +78,7 @@ fn main() -> anyhow::Result<()> {
7578 return Ok ( ( ) ) ;
7679 }
7780 }
78- if config. issue_reference_required . unwrap_or ( false ) && ! issue {
81+ if config. issue_reference_required . unwrap_or ( false ) && issue. is_none ( ) {
7982 println ! ( "{}" , "Issue reference is required for commits." . red( ) ) ;
8083 return Err ( anyhow:: anyhow!( "Issue reference required" ) ) ;
8184 }
You can’t perform that action at this time.
0 commit comments