@@ -46,29 +46,6 @@ enum rebase_type {
4646 REBASE_PRESERVE_MERGES
4747};
4848
49- static int use_builtin_rebase (void )
50- {
51- struct child_process cp = CHILD_PROCESS_INIT ;
52- struct strbuf out = STRBUF_INIT ;
53- int ret , env = git_env_bool ("GIT_TEST_REBASE_USE_BUILTIN" , -1 );
54-
55- if (env != -1 )
56- return env ;
57-
58- argv_array_pushl (& cp .args ,
59- "config" , "--bool" , "rebase.usebuiltin" , NULL );
60- cp .git_cmd = 1 ;
61- if (capture_command (& cp , & out , 6 )) {
62- strbuf_release (& out );
63- return 1 ;
64- }
65-
66- strbuf_trim (& out );
67- ret = !strcmp ("true" , out .buf );
68- strbuf_release (& out );
69- return ret ;
70- }
71-
7249struct rebase_options {
7350 enum rebase_type type ;
7451 const char * state_dir ;
@@ -106,6 +83,7 @@ struct rebase_options {
10683 char * strategy , * strategy_opts ;
10784 struct strbuf git_format_patch_opt ;
10885 int reschedule_failed_exec ;
86+ int use_legacy_rebase ;
10987};
11088
11189static int is_interactive (struct rebase_options * opts )
@@ -874,6 +852,11 @@ static int rebase_config(const char *var, const char *value, void *data)
874852 return 0 ;
875853 }
876854
855+ if (!strcmp (var , "rebase.usebuiltin" )) {
856+ opts -> use_legacy_rebase = !git_config_bool (var , value );
857+ return 0 ;
858+ }
859+
877860 return git_default_config (var , value , data );
878861}
879862
@@ -1148,22 +1131,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
11481131 };
11491132 int i ;
11501133
1151- /*
1152- * NEEDSWORK: Once the builtin rebase has been tested enough
1153- * and git-legacy-rebase.sh is retired to contrib/, this preamble
1154- * can be removed.
1155- */
1156-
1157- if (!use_builtin_rebase ()) {
1158- const char * path = mkpath ("%s/git-legacy-rebase" ,
1159- git_exec_path ());
1160-
1161- if (sane_execvp (path , (char * * )argv ) < 0 )
1162- die_errno (_ ("could not exec %s" ), path );
1163- else
1164- BUG ("sane_execvp() returned???" );
1165- }
1166-
11671134 if (argc == 2 && !strcmp (argv [1 ], "-h" ))
11681135 usage_with_options (builtin_rebase_usage ,
11691136 builtin_rebase_options );
@@ -1174,6 +1141,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
11741141
11751142 git_config (rebase_config , & options );
11761143
1144+ if (options .use_legacy_rebase ||
1145+ !git_env_bool ("GIT_TEST_REBASE_USE_BUILTIN" , -1 ))
1146+ warning (_ ("the rebase.useBuiltin support has been removed!\n"
1147+ "See its entry in 'git help config' for details." ));
1148+
11771149 strbuf_reset (& buf );
11781150 strbuf_addf (& buf , "%s/applying" , apply_dir ());
11791151 if (file_exists (buf .buf ))
0 commit comments