@@ -238,68 +238,25 @@ static int refresh(int verbose, const struct pathspec *pathspec)
238238 return ret ;
239239}
240240
241- int run_add_interactive (const char * revision , const char * patch_mode ,
242- const struct pathspec * pathspec )
243- {
244- int i ;
245- struct child_process cmd = CHILD_PROCESS_INIT ;
246- int use_builtin_add_i =
247- git_env_bool ("GIT_TEST_ADD_I_USE_BUILTIN" , -1 );
248-
249- if (use_builtin_add_i < 0 &&
250- git_config_get_bool ("add.interactive.usebuiltin" ,
251- & use_builtin_add_i ))
252- use_builtin_add_i = 1 ;
253-
254- if (use_builtin_add_i != 0 ) {
255- enum add_p_mode mode ;
256-
257- if (!patch_mode )
258- return !!run_add_i (the_repository , pathspec );
259-
260- if (!strcmp (patch_mode , "--patch" ))
261- mode = ADD_P_ADD ;
262- else if (!strcmp (patch_mode , "--patch=stash" ))
263- mode = ADD_P_STASH ;
264- else if (!strcmp (patch_mode , "--patch=reset" ))
265- mode = ADD_P_RESET ;
266- else if (!strcmp (patch_mode , "--patch=checkout" ))
267- mode = ADD_P_CHECKOUT ;
268- else if (!strcmp (patch_mode , "--patch=worktree" ))
269- mode = ADD_P_WORKTREE ;
270- else
271- die ("'%s' not supported" , patch_mode );
272-
273- return !!run_add_p (the_repository , mode , revision , pathspec );
274- }
275-
276- strvec_push (& cmd .args , "add--interactive" );
277- if (patch_mode )
278- strvec_push (& cmd .args , patch_mode );
279- if (revision )
280- strvec_push (& cmd .args , revision );
281- strvec_push (& cmd .args , "--" );
282- for (i = 0 ; i < pathspec -> nr ; i ++ )
283- /* pass original pathspec, to be re-parsed */
284- strvec_push (& cmd .args , pathspec -> items [i ].original );
285-
286- cmd .git_cmd = 1 ;
287- return run_command (& cmd );
288- }
289-
290241int interactive_add (const char * * argv , const char * prefix , int patch )
291242{
292243 struct pathspec pathspec ;
244+ int unused ;
245+
246+ if (!git_config_get_bool ("add.interactive.usebuiltin" , & unused ))
247+ warning (_ ("the add.interactive.useBuiltin setting has been removed!\n"
248+ "See its entry in 'git help config' for details." ));
293249
294250 parse_pathspec (& pathspec , 0 ,
295251 PATHSPEC_PREFER_FULL |
296252 PATHSPEC_SYMLINK_LEADING_PATH |
297253 PATHSPEC_PREFIX_ORIGIN ,
298254 prefix , argv );
299255
300- return run_add_interactive (NULL ,
301- patch ? "--patch" : NULL ,
302- & pathspec );
256+ if (patch )
257+ return !!run_add_p (the_repository , ADD_P_ADD , NULL , & pathspec );
258+ else
259+ return !!run_add_i (the_repository , & pathspec );
303260}
304261
305262static int edit_patch (int argc , const char * * argv , const char * prefix )
0 commit comments