On Sun, Sep 23, 2018 at 1:04 PM Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> wrote: > A new repo extension is added, worktreeConfig. When it is present: > > - Repository config reading by default includes $GIT_DIR/config _and_ > $GIT_DIR/config.worktree. "config" file remains shared in multiple > worktree setup. > > - The special treatment for core.bare and core.worktree, to stay > effective only in main worktree, is gone. These config files are > supposed to be in config.worktree. "These config _settings_ are supposed to be..." > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> > --- > diff --git a/Documentation/config.txt b/Documentation/config.txt > @@ -2,8 +2,9 @@ CONFIGURATION FILE > The Git configuration file contains a number of variables that affect > -the Git commands' behavior. The `.git/config` file in each repository > -is used to store the configuration for that repository, and > +the Git commands' behavior. The files `.git/config` and optionally > +`config.worktree` (see `extensions.worktreeConfig` below) are each s/are/in/ > +repository is used to store the configuration for that repository, and > `$HOME/.gitconfig` is used to store a per-user configuration as > diff --git a/t/t2029-worktree-config.sh b/t/t2029-worktree-config.sh > @@ -0,0 +1,82 @@ > +cmp_config() { > + if [ "$1" = "-C" ]; then Style: if test "$1" = "-C" then ... > +} > + > +test_expect_success 'setup' ' > + test_commit start && > + git config --worktree per.worktree is-ok && Did you want: cmp_config false extensions.worktreeConfig at this point in the test or something? It's not clear what the intention is here. > + git worktree add wt1 && > + git worktree add wt2 && > + git config --worktree per.worktree is-ok && > + cmp_config true extensions.worktreeConfig > +' > +test_expect_success 'core.bare no longer for main only' ' > + git config core.bare true && > + cmp_config true core.bare && > + cmp_config -C wt1 true core.bare && > + cmp_config -C wt2 true core.bare && > + git config --unset core.bare Should this be? test_when_finished "git config --unset core.bare" && or perhaps test_config()? > +'