aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-06 13:38:11 -0700
committerJunio C Hamano <gitster@pobox.com>2016-07-06 13:38:11 -0700
commit7a738b40f67fc44c2a2c1abcffe474241af3d30e (patch)
tree38045c933a3d7247599a9d2f5ba0d981ea7a8832 /contrib
parentf1e80a12a485c1d3092cef96aa4a101405d326f9 (diff)
parent0409e0b6dc169b07c05d02e8b62389b1cc975a45 (diff)
downloadgit-7a738b40f67fc44c2a2c1abcffe474241af3d30e.tar.gz
git-7a738b40f67fc44c2a2c1abcffe474241af3d30e.tar.xz
Merge branch 'nd/worktree-cleanup-post-head-protection'
Further preparatory clean-up for "worktree" feature continues. * nd/worktree-cleanup-post-head-protection: worktree: simplify prefixing paths worktree: avoid 0{40}, too many zeroes, hard to read worktree.c: use is_dot_or_dotdot() git-worktree.txt: keep subcommand listing in alphabetical order worktree.c: rewrite mark_current_worktree() to avoid strbuf completion: support git-worktree
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-completion.bash23
1 files changed, 23 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index ddda5e5e2..37888f4e5 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2691,6 +2691,29 @@ _git_whatchanged ()
_git_log
}
+_git_worktree ()
+{
+ local subcommands="add list 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"
+ ;;
+ prune,--*)
+ __gitcomp "--dry-run --expire --verbose"
+ ;;
+ *)
+ ;;
+ esac
+ fi
+}
+
__git_main ()
{
local i c=1 command __git_dir