bash: not all 'git bisect' subcommands make sense when not bisecting
[gitweb.git] / contrib / completion / git-completion.bash
index 5e023d415b36b9be380e95e986aa87610f61f9bf..d739113153cce21b2eee6d2f2d62f2ac9b9ea066 100755 (executable)
@@ -907,7 +907,11 @@ _git_bisect ()
        local subcommands="start bad good skip reset visualize replay log run"
        local subcommand="$(__git_find_on_cmdline "$subcommands")"
        if [ -z "$subcommand" ]; then
-               __gitcomp "$subcommands"
+               if [ -f "$(__gitdir)"/BISECT_START ]; then
+                       __gitcomp "$subcommands"
+               else
+                       __gitcomp "replay start"
+               fi
                return
        fi