@@ -13,6 +13,25 @@ complete ()
13
13
return 0
14
14
}
15
15
16
+ # Be careful when updating this list:
17
+ #
18
+ # (1) The build tree may have build artifact from different branch, or
19
+ # the user's $PATH may have a random executable that may begin
20
+ # with "git-check" that are not part of the subcommands this build
21
+ # will ship, e.g. "check-ignore". The tests for completion for
22
+ # subcommand names tests how "check" is expanded; we limit the
23
+ # possible candidates to "checkout" and "check-attr" to make sure
24
+ # "check-attr", which is known by the filter function as a
25
+ # subcommand to be thrown out, while excluding other random files
26
+ # that happen to begin with "check" to avoid letting them get in
27
+ # the way.
28
+ #
29
+ # (2) A test makes sure that common subcommands are included in the
30
+ # completion for "git <TAB>", and a plumbing is excluded. "add",
31
+ # "filter-branch" and "ls-files" are listed for this.
32
+
33
+ GIT_TESTING_COMMAND_COMPLETION=' add checkout check-attr filter-branch ls-files'
34
+
16
35
. " $GIT_BUILD_DIR /contrib/completion/git-completion.bash"
17
36
18
37
# We don't need this function to actually join words or do anything special.
@@ -196,7 +215,6 @@ test_expect_success 'general options plus command' '
196
215
test_completion "git --paginate check" "checkout " &&
197
216
test_completion "git --git-dir=foo check" "checkout " &&
198
217
test_completion "git --bare check" "checkout " &&
199
- test_completion "git --help des" "describe " &&
200
218
test_completion "git --exec-path=foo check" "checkout " &&
201
219
test_completion "git --html-path check" "checkout " &&
202
220
test_completion "git --no-pager check" "checkout " &&
@@ -207,6 +225,11 @@ test_expect_success 'general options plus command' '
207
225
test_completion "git --no-replace-objects check" "checkout "
208
226
'
209
227
228
+ test_expect_success ' git --help completion' '
229
+ test_completion "git --help ad" "add " &&
230
+ test_completion "git --help core" "core-tutorial "
231
+ '
232
+
210
233
test_expect_success ' setup for ref completion' '
211
234
echo content >file1 &&
212
235
echo more >file2 &&
0 commit comments