2396
'
2397
2398
test_expect_success 'sourcing the completion script clears cached commands' '
2399
- __git_compute_all_commands &&
2400
- verbose test -n "$__git_all_commands" &&
2401
- . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
2402
- verbose test -z "$__git_all_commands"
2399
+ (
2400
+ __git_compute_all_commands &&
2401
+ verbose test -n "$__git_all_commands" &&
2402
+ . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
2403
+ verbose test -z "$__git_all_commands"
2404
+ )
2405
'
2406
2407
test_expect_success 'sourcing the completion script clears cached merge strategies' '
2406
- __git_compute_merge_strategies &&
2407
- verbose test -n "$__git_merge_strategies" &&
2408
- . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
2409
- verbose test -z "$__git_merge_strategies"
2408
+ (
2409
+ __git_compute_merge_strategies &&
2410
+ verbose test -n "$__git_merge_strategies" &&
2411
+ . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
2412
+ verbose test -z "$__git_merge_strategies"
2413
+ )
2414
'
2415
2416
test_expect_success 'sourcing the completion script clears cached --options' '
2413
- __gitcomp_builtin checkout &&
2414
- verbose test -n "$__gitcomp_builtin_checkout" &&
2415
- __gitcomp_builtin notes_edit &&
2416
- verbose test -n "$__gitcomp_builtin_notes_edit" &&
2417
- . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
2418
- verbose test -z "$__gitcomp_builtin_checkout" &&
2419
- verbose test -z "$__gitcomp_builtin_notes_edit"
2417
+ (
2418
+ __gitcomp_builtin checkout &&
2419
+ verbose test -n "$__gitcomp_builtin_checkout" &&
2420
+ __gitcomp_builtin notes_edit &&
2421
+ verbose test -n "$__gitcomp_builtin_notes_edit" &&
2422
+ . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
2423
+ verbose test -z "$__gitcomp_builtin_checkout" &&
2424
+ verbose test -z "$__gitcomp_builtin_notes_edit"
2425
+ )
2426
'
2427
2428
test_expect_success 'option aliases are not shown by default' '
2430
'
2431
2432
test_expect_success 'option aliases are shown with GIT_COMPLETION_SHOW_ALL' '
2427
- . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
2428
- GIT_COMPLETION_SHOW_ALL=1 && export GIT_COMPLETION_SHOW_ALL &&
2429
- test_completion "git clone --recurs" <<-\EOF
2430
- --recurse-submodules Z
2431
- --recursive Z
2432
- EOF
2433
+ (
2434
+ . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
2435
+ GIT_COMPLETION_SHOW_ALL=1 && export GIT_COMPLETION_SHOW_ALL &&
2436
+ test_completion "git clone --recurs" <<-\EOF
2437
+ --recurse-submodules Z
2438
+ --recursive Z
2439
+ EOF
2440
+ )
2441
'
2442
2443
test_expect_success '__git_complete' '