completion: support "git fetch --multiple"
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Thu, 20 Sep 2018 16:37:33 +0000 (18:37 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Sep 2018 16:34:43 +0000 (09:34 -0700)
When --multiple is given, the remaining arguments are remote names,
not one remote followed by zero or more refspec. Detect this case,
disable refspec completion, and pretend no remote is seen in order to
complete multiple of them.

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 d63d2dffd4e12186e734adb0cc2ae7c1db7a6374..a66bec966bd58828dd52ae619d148881853ccb6f 100644 (file)
@@ -943,6 +943,7 @@ __git_complete_remote_or_refspec ()
                        *) ;;
                        esac
                        ;;
+               --multiple) no_complete_refspec=1; break ;;
                -*) ;;
                *) remote="$i"; break ;;
                esac