completion: use __gitcomp_builtin in _git_cherry_pick
The new completable options are: --allow-empty --allow-empty-message --ff --gpg-sign --keep-redundant-commits --strategy-option In-progress options like --continue will be part of --git-completion-helper then filtered out by _git_cherry_pick() unless the operation is in progress. This helps keep marking of these operations in just one place. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Feb 9, 2018 at 18:01 UTC
660003e29acae9a5283ad8881a524a2b329336e3
1 file changed
+5
-2
contrib/completion/git-completion.bash
+5
-2
@@ -1283,16 +1283,19 @@ _git_cherry ()
1283
__git_complete_refs
1284
}
1285
1286
+__git_cherry_pick_inprogress_options="--continue --quit --abort"
1287
+
1288
_git_cherry_pick ()
1289
{
1290
__git_find_repo_path
1291
if [ -f "$__git_repo_path"/CHERRY_PICK_HEAD ]; then
1290
- __gitcomp "--continue --quit --abort"
1292
+ __gitcomp "$__git_cherry_pick_inprogress_options"
1293
return
1294
fi
1295
case "$cur" in
1296
--*)
1295
- __gitcomp "--edit --no-commit --signoff --strategy= --mainline"
1297
+ __gitcomp_builtin cherry-pick "" \
1298
+ "$__git_cherry_pick_inprogress_options"
1299
;;
1300
*)
1301
__git_complete_refs