Commit 67f1fe5f authored by Thomas Rast's avatar Thomas Rast Committed by Junio C Hamano

bash completion: only show 'log --merge' if merging

The gitk completion only shows --merge if MERGE_HEAD is present.
Do it the same way for git-log completion.
Signed-off-by: default avatarThomas Rast <[email protected]>
Acked-by: default avatarShawn O. Pearce <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent abfd5fa8
......@@ -937,6 +937,11 @@ _git_log ()
__git_has_doubledash && return
local cur="${COMP_WORDS[COMP_CWORD]}"
local g="$(git rev-parse --git-dir 2>/dev/null)"
local merge=""
if [ -f $g/MERGE_HEAD ]; then
merge="--merge"
fi
case "$cur" in
--pretty=*)
__gitcomp "
......@@ -968,7 +973,7 @@ _git_log ()
--decorate --diff-filter=
--color-words --walk-reflogs
--parents --children --full-history
--merge
$merge
"
return
;;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment