mirror of
https://github.com/git/git.git
synced 2026-08-09 01:21:47 +00:00
completion: complete 'git history --update-refs' values
The "--update-refs" option accepts either "branches" or "head". Complete these values. Although the synopsis only documents the: --update-refs=<value> form, parse-options also accepts the value as a separate argument: --update-refs <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
96b8e2f988
commit
e500dcc192
@@ -2181,6 +2181,11 @@ _git_history ()
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
--update-refs,*|*,--update-refs=*)
|
||||
__gitcomp "branches head" "" \
|
||||
"${cur##--update-refs=}"
|
||||
return
|
||||
;;
|
||||
*,--*)
|
||||
__gitcomp_builtin "history_$subcommand"
|
||||
return
|
||||
|
||||
@@ -3129,7 +3129,11 @@ test_expect_success 'git history subcommand options' '
|
||||
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_completion "git history reword --empty=ke" "" &&
|
||||
test_completion "git history fixup --update-refs=he" "head " &&
|
||||
test_completion "git history split --update-refs he" "head " &&
|
||||
test_completion "git history reword main -- --update-refs=he" "" &&
|
||||
test_completion "git history reword main -- --update-refs he" ""
|
||||
'
|
||||
|
||||
test_expect_success 'git history revisions' '
|
||||
|
||||
Reference in New Issue
Block a user