mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
revert "checkout: introduce checkout.overlayMode config"
This reverts 1495ff7da5
("checkout: introduce checkout.overlayMode
config", 2019-01-08) and thus removes the checkout.overlayMode config
option.
The option was originally introduced to give users the option to make
the new no-overlay behaviour the default. However users may be using
'git checkout' in scripts, even though it is porcelain. Users setting
the option to false may actually end up accidentally breaking scripts.
With the introduction of a new subcommand that will make the behaviour
the default, the config option will not be needed anymore anyway.
Revert the commit and remove the config option, so we don't risk
breaking scripts.
Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
1495ff7da5
commit
e92aa0e4ef
|
@ -21,10 +21,3 @@ checkout.optimizeNewBranch::
|
||||||
will not update the skip-worktree bit in the index nor add/remove
|
will not update the skip-worktree bit in the index nor add/remove
|
||||||
files in the working directory to reflect the current sparse checkout
|
files in the working directory to reflect the current sparse checkout
|
||||||
settings nor will it show the local changes.
|
settings nor will it show the local changes.
|
||||||
|
|
||||||
checkout.overlayMode::
|
|
||||||
In the default overlay mode, `git checkout` never
|
|
||||||
removes files from the index or the working tree. When
|
|
||||||
setting `checkout.overlayMode` to false, files that appear in
|
|
||||||
the index and working tree, but not in <tree-ish> are removed,
|
|
||||||
to make them match <tree-ish> exactly.
|
|
||||||
|
|
|
@ -1019,19 +1019,13 @@ static int switch_branches(const struct checkout_opts *opts,
|
||||||
|
|
||||||
static int git_checkout_config(const char *var, const char *value, void *cb)
|
static int git_checkout_config(const char *var, const char *value, void *cb)
|
||||||
{
|
{
|
||||||
struct checkout_opts *opts = cb;
|
|
||||||
|
|
||||||
if (!strcmp(var, "checkout.optimizenewbranch")) {
|
if (!strcmp(var, "checkout.optimizenewbranch")) {
|
||||||
checkout_optimize_new_branch = git_config_bool(var, value);
|
checkout_optimize_new_branch = git_config_bool(var, value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(var, "checkout.overlaymode")) {
|
|
||||||
opts->overlay_mode = git_config_bool(var, value);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!strcmp(var, "diff.ignoresubmodules")) {
|
if (!strcmp(var, "diff.ignoresubmodules")) {
|
||||||
|
struct checkout_opts *opts = cb;
|
||||||
handle_ignore_submodules_arg(&opts->diff_options, value);
|
handle_ignore_submodules_arg(&opts->diff_options, value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,14 +44,4 @@ test_expect_success '--no-overlay --theirs with D/F conflict deletes file' '
|
||||||
test_path_is_missing file1
|
test_path_is_missing file1
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'checkout with checkout.overlayMode=false deletes files not in <tree-ish>' '
|
|
||||||
>file &&
|
|
||||||
mkdir dir &&
|
|
||||||
>dir/file1 &&
|
|
||||||
git add file dir/file1 &&
|
|
||||||
git -c checkout.overlayMode=false checkout HEAD -- file &&
|
|
||||||
test_path_is_missing file &&
|
|
||||||
test_path_is_file dir/file1
|
|
||||||
'
|
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Loading…
Reference in a new issue