[PATCH v5 0/2] Worktree: for-each function and list command
- From
Michael Rappazzo <rappazzo@gmail.com>
- Date
- Aug 22, 2015, 21:51 UTC
- Message-ID
- <1440280294-50679-1-git-send-email-rappazzo@gmail.com>
Changes since v4: - reduced memory usage by reusing string buffer variables - re-scoped variables in the for-each function - added tests for 'worktree list' with bare repos
Notes from previous discussion: - The following snippet:
> + /* If the common_dir DOES NOT end with '/.git', then it is bare */ > + main_is_bare = !strbuf_strip_suffix(&worktree_path, "/.git");
This code is run when the current dir is in a linked worktree (not the primary worktree). In that context, the git config _does_ report that 'core.bare' is true when the primary repo is bare, however `is_bare_repository()` returns false. The worktree_path also needs to the "/.git" removed from it. Therefore, I opted to keep the code like this.
Michael Rappazzo (2): worktree: add 'for_each_worktree' function worktree: add 'list' command
Documentation/git-worktree.txt | 11 +++- builtin/worktree.c | 138 +++++++++++++++++++++++++++++++++++++++++ t/t2027-worktree-list.sh | 81 ++++++++++++++++++++++++ 3 files changed, 229 insertions(+), 1 deletion(-) create mode 100755 t/t2027-worktree-list.sh
-- 2.5.0