99 * File Created: 2025-03-01 17:17:30
1010 *
1111 * Modified By: mingcheng ([email protected] ) 12- <<<<<<< HEAD
13- * 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
12+ * Last Modified: 2025-03-04 16:30:20
2113 */
2214
2315use aigitcommit:: cli:: Cli ;
@@ -119,7 +111,6 @@ async fn main() -> std::result::Result<(), Box<dyn Error>> {
119111 trace ! ( "write to stdout, and finish the process" ) ;
120112 writeln ! ( std:: io:: stdout( ) , "{}" , result) ?;
121113
122- <<<<<<< HEAD
123114 // Copy the commit message to clipboard if the --copy option is enabled
124115 if cli. copy {
125116 let mut clipboard = Clipboard :: new ( ) ?;
@@ -133,42 +124,13 @@ async fn main() -> std::result::Result<(), Box<dyn Error>> {
133124 // directly commit the changes to the repository if the --commit option is enabled
134125 if cli. commit {
135126 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
161127 let mut confirm = Confirm :: new ( ) ;
162128 confirm
163129 . with_prompt ( "Do you want to commit the changes with the generated commit message?" )
164130 . default ( false ) ;
165131
166132 // Prompt the user for confirmation if --yes option is not enabled
167133 if cli. yes || confirm. interact ( ) ? {
168- <<<<<<< HEAD
169- =======
170- >>>>>>> release/1.2 . 0
171- >>>>>>> main
172134 match repository. commit ( & result) {
173135 Ok ( _) => {
174136 writeln ! ( std:: io:: stdout( ) , "Commit successful!" ) ?;
@@ -178,21 +140,7 @@ async fn main() -> std::result::Result<(), Box<dyn Error>> {
178140 }
179141 }
180142 }
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- =======
194143 }
195- >>>>>>> main
196144
197145 // If the --save option is enabled, save the commit message to a file
198146 if !cli. save . is_empty ( ) {
@@ -207,9 +155,5 @@ async fn main() -> std::result::Result<(), Box<dyn Error>> {
207155 writeln ! ( std:: io:: stdout( ) , "Commit message saved to {}" , & save_path) ?;
208156 }
209157
210- <<<<<<< HEAD
211- =======
212- >>>>>>> release/1.2 . 0
213- >>>>>>> main
214158 Ok ( ( ) )
215159}
0 commit comments