mirror of
https://github.com/git/git.git
synced 2026-08-09 09:34:14 +00:00
completion: complete 'git history --empty' values
The "--empty" option accepts "drop", "keep", or "abort" for the "drop" and "fixup" subcommands. Complete these values. Although the synopsis only documents the: --empty=<value> form, parse-options also accepts the value as a separate argument: --empty <value> Support both forms to follow the parser. Signed-off-by: Vincent Mailhol <mailhol@kernel.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
0d73fefff6
commit
96b8e2f988
@@ -2171,8 +2171,17 @@ _git_history ()
|
||||
fi
|
||||
|
||||
if ! __git_has_doubledash; then
|
||||
case "$cur" in
|
||||
--*)
|
||||
case "$prev,$cur" in
|
||||
--empty,*|*,--empty=*)
|
||||
case "$subcommand" in
|
||||
drop|fixup)
|
||||
__gitcomp "drop keep abort" "" \
|
||||
"${cur##--empty=}"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*,--*)
|
||||
__gitcomp_builtin "history_$subcommand"
|
||||
return
|
||||
;;
|
||||
|
||||
@@ -3126,7 +3126,10 @@ test_expect_success 'git history subcommand options' '
|
||||
test_completion "git history fixup --ree" "--reedit-message " &&
|
||||
test_completion "git history split --upd" "--update-refs=" &&
|
||||
test_completion "git history split main --dry" "--dry-run " &&
|
||||
test_completion "git history reword main -- --d" ""
|
||||
test_completion "git history reword main -- --d" "" &&
|
||||
test_completion "git history fixup --empty=ke" "keep " &&
|
||||
test_completion "git history drop --empty ab" "abort " &&
|
||||
test_completion "git history reword --empty=ke" ""
|
||||
'
|
||||
|
||||
test_expect_success 'git history revisions' '
|
||||
|
||||
Reference in New Issue
Block a user