completion: fix completing merge strategies on non-C locales
authorDuy Nguyen <pclouds@gmail.com>
Fri, 26 Jan 2018 01:31:42 +0000 (08:31 +0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 26 Jan 2018 17:48:14 +0000 (09:48 -0800)
The anchor string "Available strategies are:" is translatable so
__git_list_merge_strategies may fail to collect available strategies
from 'git merge' on non-C locales. Force C locale on this command.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash
index 3683c772c5586ccc1f6dfc8c047919d8d96aa891..88813e91244d820b4aa2c0fb5e60a44db03c3e59 100644 (file)
@@ -594,7 +594,7 @@ __git_is_configured_remote ()
 
 __git_list_merge_strategies ()
 {
-       git merge -s help 2>&1 |
+       LANG=C LC_ALL=C git merge -s help 2>&1 |
        sed -n -e '/[Aa]vailable strategies are: /,/^$/{
                s/\.$//
                s/.*://