13
return 0
14
}
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
+
35
. "$GIT_BUILD_DIR/contrib/completion/git-completion.bash"
36
37
# We don't need this function to actually join words or do anything special.
215
test_completion "git --paginate check" "checkout " &&
216
test_completion "git --git-dir=foo check" "checkout " &&
217
test_completion "git --bare check" "checkout " &&
199
- test_completion "git --help des" "describe " &&
218
test_completion "git --exec-path=foo check" "checkout " &&
219
test_completion "git --html-path check" "checkout " &&
220
test_completion "git --no-pager check" "checkout " &&
225
test_completion "git --no-replace-objects check" "checkout "
226
'
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
+
233
test_expect_success 'setup for ref completion' '
234
echo content >file1 &&
235
echo more >file2 &&