worktree: add "lock" command
[gitweb.git] / contrib / completion / git-completion.bash
index ffe60048c1e50a2b3d9282cbab09721710232fbe..f88727dfe771614de04dcfacb24f4bf2c37e8d1e 100644 (file)
@@ -1458,6 +1458,7 @@ _git_log ()
                        --relative-date --date=
                        --pretty= --format= --oneline
                        --show-signature
+                       --cherry-mark
                        --cherry-pick
                        --graph
                        --decorate --decorate=
@@ -2594,6 +2595,32 @@ _git_whatchanged ()
        _git_log
 }
 
+_git_worktree ()
+{
+       local subcommands="add list lock prune"
+       local subcommand="$(__git_find_on_cmdline "$subcommands")"
+       if [ -z "$subcommand" ]; then
+               __gitcomp "$subcommands"
+       else
+               case "$subcommand,$cur" in
+               add,--*)
+                       __gitcomp "--detach"
+                       ;;
+               list,--*)
+                       __gitcomp "--porcelain"
+                       ;;
+               lock,--*)
+                       __gitcomp "--reason"
+                       ;;
+               prune,--*)
+                       __gitcomp "--dry-run --expire --verbose"
+                       ;;
+               *)
+                       ;;
+               esac
+       fi
+}
+
 __git_main ()
 {
        local i c=1 command __git_dir