]> git.ipfire.org Git - thirdparty/git.git/commitdiff
config: document and test the 'worktree' scope
authorGlen Choo <chooglen@google.com>
Tue, 7 Jun 2022 21:24:04 +0000 (21:24 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 Jun 2022 01:14:25 +0000 (18:14 -0700)
Test that "git config --show-scope" shows the "worktree" scope, and add
it to the list of scopes in Documentation/git-config.txt.

"git config --help" does not need to be updated because it already
mentions "worktree".

Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-config.txt
t/t1300-config.sh

index bdcfd94b642867159ae8683e42624f8e838b6444..9376e39aef206ae8d687dcf2066727de746e7c71 100644 (file)
@@ -248,7 +248,7 @@ Valid `<type>`'s include:
 --show-scope::
        Similar to `--show-origin` in that it augments the output of
        all queried config options with the scope of that value
-       (local, global, system, command).
+       (worktree, local, global, system, command).
 
 --get-colorbool <name> [<stdout-is-tty>]::
 
index 7dd9b325d90fd1151f5a4202cad60d8a72df7780..d3d9adbb3dba675ea6b22d7006faa4884315f4ae 100755 (executable)
@@ -2024,8 +2024,17 @@ test_expect_success '--show-scope with --list' '
        local   user.override=local
        local   include.path=../include/relative.include
        local   user.relative=include
+       local   core.repositoryformatversion=1
+       local   extensions.worktreeconfig=true
+       worktree        user.worktree=true
        command user.cmdline=true
        EOF
+       git worktree add wt1 &&
+       # We need these to test for worktree scope, but outside of this
+       # test, this is just noise
+       test_config core.repositoryformatversion 1 &&
+       test_config extensions.worktreeConfig true &&
+       git config --worktree user.worktree true &&
        git -c user.cmdline=true config --list --show-scope >output &&
        test_cmp expect output
 '