Re: [PATCH 14/14] completion: add default merge strategies
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 24, 2019, 17:23 UTC
- Message-ID
- <xmqq5zouj3rl.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20190621223107.8022-15-felipe.contreras@gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
> In case the command fails.
It is unclear what you wanted to say with this. What command? After "git merge" fails?
Show 42 quoted lines
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
> contrib/completion/git-completion.bash | 4 +++-
> t/t9902-completion.sh | 2 +-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 922ba5f925..91b87eb558 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -936,6 +936,7 @@ __git_list_merge_strategies ()
> }'
> }
>
> +__git_merge_strategies_default='octopus ours recursive resolve subtree'
> __git_merge_strategies=
> # 'git merge -s help' (and thus detection of the merge strategy
> # list) fails, unfortunately, if run outside of any git working
> @@ -945,7 +946,8 @@ __git_merge_strategies=
> __git_compute_merge_strategies ()
> {
> test -n "$__git_merge_strategies" ||
> - __git_merge_strategies=$(__git_list_merge_strategies)
> + { __git_merge_strategies=$(__git_list_merge_strategies);
> + __git_merge_strategies="${__git_merge_strategies:-__git_merge_strategies_default}"; }
> }
>
> __git_merge_strategy_options="ours theirs subtree subtree= patience
> diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
> index 14598bfbec..f4453ce70d 100755
> --- a/t/t9902-completion.sh
> +++ b/t/t9902-completion.sh
> @@ -1722,7 +1722,7 @@ test_expect_success 'sourcing the completion script clears cached commands' '
> verbose test -z "$__git_all_commands"
> '
>
> -test_expect_failure 'sourcing the completion script clears cached merge strategies' '
> +test_expect_success 'sourcing the completion script clears cached merge strategies' '
> offgit &&
> GIT_TEST_GETTEXT_POISON= &&
> __git_compute_merge_strategies &&