File tree Expand file tree Collapse file tree 2 files changed +2
-29
lines changed Expand file tree Collapse file tree 2 files changed +2
-29
lines changed Original file line number Diff line number Diff line change @@ -146,30 +146,4 @@ impl Git {
146
146
147
147
Ok ( status_value)
148
148
}
149
-
150
- pub fn add_all ( self : & Self ) {
151
- self . repo
152
- . index ( )
153
- . unwrap ( )
154
- . add_all ( & [ "." ] , git2:: IndexAddOption :: DEFAULT , None )
155
- . unwrap ( ) ;
156
- }
157
-
158
- pub fn commit ( self : & Self , message : String ) {
159
- let mut index = self . repo . index ( ) . unwrap ( ) ;
160
- let oid = index. write_tree ( ) . unwrap ( ) ;
161
- let signature = self . repo . signature ( ) . unwrap ( ) ;
162
- let parent_commit = self . repo . head ( ) . unwrap ( ) . peel_to_commit ( ) . unwrap ( ) ;
163
- let tree = self . repo . find_tree ( oid) . unwrap ( ) ;
164
- self . repo
165
- . commit (
166
- Some ( "HEAD" ) ,
167
- & signature,
168
- & signature,
169
- & message,
170
- & tree,
171
- & [ & parent_commit] ,
172
- )
173
- . unwrap ( ) ;
174
- }
175
149
}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use colored::Colorize;
12
12
use gpt_api:: query;
13
13
14
14
use crate :: {
15
- command_utils:: parse_command,
15
+ command_utils:: { parse_command, run_commands } ,
16
16
git:: { build_commands, Git } ,
17
17
utils:: { check_for_update, get_executable_name} ,
18
18
} ;
@@ -190,8 +190,7 @@ async fn main() {
190
190
std:: io:: stdin ( ) . read_line ( & mut input) . unwrap ( ) ;
191
191
println ! ( "" ) ;
192
192
if input. trim ( ) == "y" || input. trim ( ) == "Y" || input. trim ( ) == "" {
193
- git. add_all ( ) ;
194
- git. commit ( result) ;
193
+ run_commands ( & result) ;
195
194
std:: process:: exit ( 0 ) ;
196
195
} else if input. trim ( ) == "n" || input. trim ( ) == "N" {
197
196
println ! ( "{}" , "Aborted" . red( ) ) ;
You can’t perform that action at this time.
0 commit comments