Git fork

Merge branch 'nd/parseopt-completion'

Hotfix for recently graduated topic that give help to completion
scripts from the Git subcommands that are being completed

* nd/parseopt-completion:
t9902: disable test on the list of merge-strategies under GETTEXT_POISON
completion: clear cached --options when sourcing the completion script

+35
+4
contrib/completion/git-completion.bash
··· 280 280 esac 281 281 } 282 282 283 + # Clear the variables caching builtins' options when (re-)sourcing 284 + # the completion script. 285 + unset $(set |sed -ne 's/^\(__gitcomp_builtin_[a-zA-Z0-9_][a-zA-Z0-9_]*\)=.*/\1/p') 2>/dev/null 286 + 283 287 # This function is equivalent to 284 288 # 285 289 # __gitcomp "$(git xxx --git-completion-helper) ..."
+31
t/t9902-completion.sh
··· 1497 1497 ' 1498 1498 done 1499 1499 1500 + test_expect_success 'sourcing the completion script clears cached commands' ' 1501 + __git_compute_all_commands && 1502 + verbose test -n "$__git_all_commands" && 1503 + . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" && 1504 + verbose test -z "$__git_all_commands" 1505 + ' 1506 + 1507 + test_expect_success 'sourcing the completion script clears cached porcelain commands' ' 1508 + __git_compute_porcelain_commands && 1509 + verbose test -n "$__git_porcelain_commands" && 1510 + . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" && 1511 + verbose test -z "$__git_porcelain_commands" 1512 + ' 1513 + 1514 + test_expect_success !GETTEXT_POISON 'sourcing the completion script clears cached merge strategies' ' 1515 + __git_compute_merge_strategies && 1516 + verbose test -n "$__git_merge_strategies" && 1517 + . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" && 1518 + verbose test -z "$__git_merge_strategies" 1519 + ' 1520 + 1521 + test_expect_success 'sourcing the completion script clears cached --options' ' 1522 + __gitcomp_builtin checkout && 1523 + verbose test -n "$__gitcomp_builtin_checkout" && 1524 + __gitcomp_builtin notes_edit && 1525 + verbose test -n "$__gitcomp_builtin_notes_edit" && 1526 + . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" && 1527 + verbose test -z "$__gitcomp_builtin_checkout" && 1528 + verbose test -z "$__gitcomp_builtin_notes_edit" 1529 + ' 1530 + 1500 1531 test_done