completion: no-op refactoring of diff completion
The "git diff" completion function punts very early when it sees "--" on the command line, since it is a sign that options or revisions can appear and the current completion does not need to do anything "git diff" specific. By returning, it lets Bash default action that completes the names of the files in $PWD to kick in. In preparation for the next step to change what happens when we "punt", arrange the code flow to avoid this early return. The behaviour at this step is unchanged, but the control flow just falls straight to the end. Signed-off-by: Junio C Hamano <gitster@pobox.com>main
parent
e9019fcafe
commit
a039ee6757
|
|
@ -1947,35 +1947,40 @@ __git_diff_difftool_options="--cached --staged
|
|||
|
||||
_git_diff ()
|
||||
{
|
||||
__git_has_doubledash && return
|
||||
|
||||
case "$cur" in
|
||||
--diff-algorithm=*)
|
||||
__gitcomp "$__git_diff_algorithms" "" "${cur##--diff-algorithm=}"
|
||||
return
|
||||
;;
|
||||
--submodule=*)
|
||||
__gitcomp "$__git_diff_submodule_formats" "" "${cur##--submodule=}"
|
||||
return
|
||||
;;
|
||||
--color-moved=*)
|
||||
__gitcomp "$__git_color_moved_opts" "" "${cur##--color-moved=}"
|
||||
return
|
||||
;;
|
||||
--color-moved-ws=*)
|
||||
__gitcomp "$__git_color_moved_ws_opts" "" "${cur##--color-moved-ws=}"
|
||||
return
|
||||
;;
|
||||
--ws-error-highlight=*)
|
||||
__gitcomp "$__git_ws_error_highlight_opts" "" "${cur##--ws-error-highlight=}"
|
||||
return
|
||||
;;
|
||||
--*)
|
||||
__gitcomp "$__git_diff_difftool_options"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__git_complete_revlist_file
|
||||
if ! __git_has_doubledash; then
|
||||
case "$cur" in
|
||||
--diff-algorithm=*)
|
||||
__gitcomp "$__git_diff_algorithms" \
|
||||
"" "${cur##--diff-algorithm=}"
|
||||
return
|
||||
;;
|
||||
--submodule=*)
|
||||
__gitcomp "$__git_diff_submodule_formats" \
|
||||
"" "${cur##--submodule=}"
|
||||
return
|
||||
;;
|
||||
--color-moved=*)
|
||||
__gitcomp "$__git_color_moved_opts" \
|
||||
"" "${cur##--color-moved=}"
|
||||
return
|
||||
;;
|
||||
--color-moved-ws=*)
|
||||
__gitcomp "$__git_color_moved_ws_opts" \
|
||||
"" "${cur##--color-moved-ws=}"
|
||||
return
|
||||
;;
|
||||
--ws-error-highlight=*)
|
||||
__gitcomp "$__git_ws_error_highlight_opts" \
|
||||
"" "${cur##--ws-error-highlight=}"
|
||||
return
|
||||
;;
|
||||
--*)
|
||||
__gitcomp "$__git_diff_difftool_options"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__git_complete_revlist_file
|
||||
fi
|
||||
}
|
||||
|
||||
__git_mergetools_common="diffuse diffmerge ecmerge emerge kdiff3 meld opendiff
|
||||
|
|
|
|||
Loading…
Reference in New Issue