99 * File Created: 2025-03-01 17:17:30
1010 *
1111 * Modified By: mingcheng ([email protected] ) 12+ <<<<<<< HEAD
1213 * Last Modified: 2025-03-04 14:46:51
14+ =======
15+ <<<<<<< HEAD
16+ * Last Modified: 2025-03-04 11:39:25
17+ =======
18+ * Last Modified: 2025-03-04 14:46:51
19+ >>>>>>> release/1.2.0
20+ >>>>>>> main
1321 */
1422
1523use aigitcommit:: cli:: Cli ;
@@ -111,6 +119,7 @@ async fn main() -> std::result::Result<(), Box<dyn Error>> {
111119 trace ! ( "write to stdout, and finish the process" ) ;
112120 writeln ! ( std:: io:: stdout( ) , "{}" , result) ?;
113121
122+ <<<<<<< HEAD
114123 // Copy the commit message to clipboard if the --copy option is enabled
115124 if cli. copy {
116125 let mut clipboard = Clipboard :: new ( ) ?;
@@ -124,13 +133,42 @@ async fn main() -> std::result::Result<(), Box<dyn Error>> {
124133 // directly commit the changes to the repository if the --commit option is enabled
125134 if cli. commit {
126135 trace!( "Commit option is enabled, will commit the changes to the repository" ) ;
136+ =======
137+ <<<<<<< HEAD
138+ // directly commit the changes to the repository if the --commit option is enabled
139+ if cli. commit {
140+ trace!( "Commit option is enabled, will commit the changes to the repository" ) ;
141+ if Confirm :: new( )
142+ . with_prompt( "\n Do you want to commit the changes with the generated commit message?" )
143+ . default ( false )
144+ . interact( ) ?
145+ {
146+ =======
147+ // Copy the commit message to clipboard if the --copy option is enabled
148+ if cli. copy {
149+ let mut clipboard = Clipboard :: new( ) ?;
150+ clipboard. set_text( & result) ?;
151+ writeln!(
152+ std:: io:: stdout( ) ,
153+ "The commit message has been copied to clipboard."
154+ ) ?;
155+ }
156+
157+ // directly commit the changes to the repository if the --commit option is enabled
158+ if cli. commit {
159+ trace!( "Commit option is enabled, will commit the changes to the repository" ) ;
160+ >>>>>>> main
127161 let mut confirm = Confirm :: new( ) ;
128162 confirm
129163 . with_prompt( "Do you want to commit the changes with the generated commit message?" )
130164 . default ( false ) ;
131165
132166 // Prompt the user for confirmation if --yes option is not enabled
133167 if cli. yes || confirm. interact( ) ? {
168+ <<<<<<< HEAD
169+ =======
170+ >>>>>>> release/1.2 . 0
171+ >>>>>>> main
134172 match repository. commit( & result) {
135173 Ok ( _) => {
136174 writeln!( std:: io:: stdout( ) , "Commit successful!" ) ?;
@@ -140,7 +178,21 @@ async fn main() -> std::result::Result<(), Box<dyn Error>> {
140178 }
141179 }
142180 }
181+ <<<<<<< HEAD
182+ }
183+ =======
184+ <<<<<<< HEAD
185+ } else if cli. copy {
186+ let mut clipboard = Clipboard :: new( ) ?;
187+ clipboard. set_text( & result) ?;
188+ write!(
189+ std:: io:: stdout( ) ,
190+ "\n The commit message has been copied to clipboard."
191+ ) ?;
192+ }
193+ =======
143194 }
195+ >>>>>>> main
144196
145197 // If the --save option is enabled, save the commit message to a file
146198 if !cli. save. is_empty( ) {
@@ -155,5 +207,9 @@ async fn main() -> std::result::Result<(), Box<dyn Error>> {
155207 writeln!( std:: io:: stdout( ) , "Commit message saved to {}" , & save_path) ?;
156208 }
157209
210+ <<<<<<< HEAD
211+ =======
212+ >>>>>>> release/1.2 . 0
213+ >>>>>>> main
158214 Ok ( ( ) )
159215}
0 commit comments