]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t9902-completion.sh
Merge branch 'dl/format-patch-cover-from-desc'
[thirdparty/git.git] / t / t9902-completion.sh
index 5187e2ede581f12c1ebe840943cb48f889b9ad44..e90ac565e13d9432b5fe5c762a63adfc8181b9fd 100755 (executable)
@@ -28,10 +28,10 @@ complete ()
 #
 # (2) A test makes sure that common subcommands are included in the
 #     completion for "git <TAB>", and a plumbing is excluded.  "add",
-#     "filter-branch" and "ls-files" are listed for this.
+#     "rebase" and "ls-files" are listed for this.
 
-GIT_TESTING_ALL_COMMAND_LIST='add checkout check-attr filter-branch ls-files'
-GIT_TESTING_PORCELAIN_COMMAND_LIST='add checkout filter-branch'
+GIT_TESTING_ALL_COMMAND_LIST='add checkout check-attr rebase ls-files'
+GIT_TESTING_PORCELAIN_COMMAND_LIST='add checkout rebase'
 
 . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash"
 
@@ -1392,12 +1392,12 @@ test_expect_success 'basic' '
        # built-in
        grep -q "^add \$" out &&
        # script
-       grep -q "^filter-branch \$" out &&
+       grep -q "^rebase \$" out &&
        # plumbing
        ! grep -q "^ls-files \$" out &&
 
-       run_completion "git f" &&
-       ! grep -q -v "^f" out
+       run_completion "git r" &&
+       ! grep -q -v "^r" out
 '
 
 test_expect_success 'double dash "git" itself' '
@@ -1701,6 +1701,69 @@ do
        '
 done
 
+test_expect_success 'git config - section' '
+       test_completion "git config br" <<-\EOF
+       branch.Z
+       browser.Z
+       EOF
+'
+
+test_expect_success 'git config - variable name' '
+       test_completion "git config log.d" <<-\EOF
+       log.date Z
+       log.decorate Z
+       EOF
+'
+
+test_expect_success 'git config - value' '
+       test_completion "git config color.pager " <<-\EOF
+       false Z
+       true Z
+       EOF
+'
+
+test_expect_success 'git -c - section' '
+       test_completion "git -c br" <<-\EOF
+       branch.Z
+       browser.Z
+       EOF
+'
+
+test_expect_success 'git -c - variable name' '
+       test_completion "git -c log.d" <<-\EOF
+       log.date=Z
+       log.decorate=Z
+       EOF
+'
+
+test_expect_success 'git -c - value' '
+       test_completion "git -c color.pager=" <<-\EOF
+       false Z
+       true Z
+       EOF
+'
+
+test_expect_success 'git clone --config= - section' '
+       test_completion "git clone --config=br" <<-\EOF
+       branch.Z
+       browser.Z
+       EOF
+'
+
+test_expect_success 'git clone --config= - variable name' '
+       test_completion "git clone --config=log.d" <<-\EOF
+       log.date=Z
+       log.decorate=Z
+       EOF
+'
+
+test_expect_success 'git clone --config= - value' '
+       test_completion "git clone --config=color.pager=" <<-\EOF
+       false Z
+       true Z
+       EOF
+'
+
 test_expect_success 'sourcing the completion script clears cached commands' '
        __git_compute_all_commands &&
        verbose test -n "$__git_all_commands" &&