Skip to content

Commit e92aa0e

Browse files
tgummerergitster
authored andcommitted
revert "checkout: introduce checkout.overlayMode config"
This reverts 1495ff7 ("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 <[email protected]> Signed-off-by: Thomas Gummerer <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1495ff7 commit e92aa0e

File tree

3 files changed

+1
-24
lines changed

3 files changed

+1
-24
lines changed

Documentation/config/checkout.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,3 @@ checkout.optimizeNewBranch::
2121
will not update the skip-worktree bit in the index nor add/remove
2222
files in the working directory to reflect the current sparse checkout
2323
settings nor will it show the local changes.
24-
25-
checkout.overlayMode::
26-
In the default overlay mode, `git checkout` never
27-
removes files from the index or the working tree. When
28-
setting `checkout.overlayMode` to false, files that appear in
29-
the index and working tree, but not in <tree-ish> are removed,
30-
to make them match <tree-ish> exactly.

builtin/checkout.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,19 +1019,13 @@ static int switch_branches(const struct checkout_opts *opts,
10191019

10201020
static int git_checkout_config(const char *var, const char *value, void *cb)
10211021
{
1022-
struct checkout_opts *opts = cb;
1023-
10241022
if (!strcmp(var, "checkout.optimizenewbranch")) {
10251023
checkout_optimize_new_branch = git_config_bool(var, value);
10261024
return 0;
10271025
}
10281026

1029-
if (!strcmp(var, "checkout.overlaymode")) {
1030-
opts->overlay_mode = git_config_bool(var, value);
1031-
return 0;
1032-
}
1033-
10341027
if (!strcmp(var, "diff.ignoresubmodules")) {
1028+
struct checkout_opts *opts = cb;
10351029
handle_ignore_submodules_arg(&opts->diff_options, value);
10361030
return 0;
10371031
}

t/t2025-checkout-no-overlay.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,4 @@ test_expect_success '--no-overlay --theirs with D/F conflict deletes file' '
4444
test_path_is_missing file1
4545
'
4646

47-
test_expect_success 'checkout with checkout.overlayMode=false deletes files not in <tree-ish>' '
48-
>file &&
49-
mkdir dir &&
50-
>dir/file1 &&
51-
git add file dir/file1 &&
52-
git -c checkout.overlayMode=false checkout HEAD -- file &&
53-
test_path_is_missing file &&
54-
test_path_is_file dir/file1
55-
'
56-
5747
test_done

0 commit comments

Comments
 (0)