Merge branch 'nd/worktree-cleanup-post-head-protection'
authorJunio C Hamano <gitster@pobox.com>
Wed, 6 Jul 2016 20:38:11 +0000 (13:38 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Jul 2016 20:38:11 +0000 (13:38 -0700)
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

1  2 
Documentation/git-worktree.txt
builtin/worktree.c
contrib/completion/git-completion.bash
worktree.c
Simple merge
index e3199a22e5a1111366b03ad0a2564e8d4f0790c7,f9dac376f748480c72023e9f4375edc90069a2ce..e866844685d519e2406c050da497c42506077f7d
@@@ -337,12 -337,9 +337,12 @@@ static int add(int ac, const char **av
        if (ac < 1 || ac > 2)
                usage_with_options(worktree_usage, options);
  
-       path = prefix ? prefix_filename(prefix, strlen(prefix), av[0]) : av[0];
+       path = prefix_filename(prefix, strlen(prefix), av[0]);
        branch = ac < 2 ? "HEAD" : av[1];
  
 +      if (!strcmp(branch, "-"))
 +              branch = "@{-1}";
 +
        opts.force_new_branch = !!new_branch_force;
        if (opts.force_new_branch) {
                struct strbuf symref = STRBUF_INIT;
Simple merge
diff --cc worktree.c
Simple merge