Skip to content

Commit 2df2d81

Browse files
committed
add -i: use the built-in version when feature.experimental is set
We have had parallel implementations of "add -i/-p" since 2.25 and have been using them from various codepaths since 2.26 days, but never made the built-in version the default. We have found and fixed a handful of corner case bugs in the built-in version, and it may be a good time to start switching over the user base from the scripted version to the built-in version. Let's enable the built-in version for those who opt into the feature.experimental guinea-pig program to give wider exposure. Acked-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3a238e5 commit 2df2d81

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

builtin/add.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,15 @@ int run_add_interactive(const char *revision, const char *patch_mode,
192192
int use_builtin_add_i =
193193
git_env_bool("GIT_TEST_ADD_I_USE_BUILTIN", -1);
194194

195-
if (use_builtin_add_i < 0)
196-
git_config_get_bool("add.interactive.usebuiltin",
197-
&use_builtin_add_i);
195+
if (use_builtin_add_i < 0) {
196+
int experimental;
197+
if (!git_config_get_bool("add.interactive.usebuiltin",
198+
&use_builtin_add_i))
199+
; /* ok */
200+
else if (!git_config_get_bool("feature.experimental", &experimental) &&
201+
experimental)
202+
use_builtin_add_i = 1;
203+
}
198204

199205
if (use_builtin_add_i == 1) {
200206
enum add_p_mode mode;

0 commit comments

Comments
 (0)