nd/worktree-move update
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest6 patches 8 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | worktree.c: add validate_worktree()worktree.c worktree.h | +71 | 2 replies | |
| 2/6 | worktree.c: add update_worktree_location()worktree.c worktree.h | +27 | 1 reply | |
| 3/6 | worktree move: new commandDocumentation/ builtin/ contrib/ +1 more | +79 | 1 reply | |
| 4/6 | worktree move: accept destination as directorybuiltin/ | +18 | 1 reply | |
| 5/6 | worktree move: refuse to move worktrees with submodulesbuiltin/ | +23 | 1 reply | |
| 6/6 | worktree remove: new commandDocumentation/ builtin/ contrib/ +1 more | +121 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/6] nd/worktree-move update
This
- squashes in Johannes' fix (that's already on jch/nd/worktree-move)
- fixes the compile problem on latest master (because prefix_filename takes one argument less)
- fixes the test failure because real_path() is called twice (the first one hidden in read_gitfile_gently) but the output is not duplicated.
builtin/worktree.c +1 -3
@@ -561,9 +561,7 @@ static int move_worktree(int ac, const char **av, const char *prefix)if (ac !=2 )usage_with_options (worktree_usage, options); -strbuf_addstr (&dst,prefix_filename (prefix, -strlen (prefix), - av[1 ])); +strbuf_addstr (&dst,prefix_filename (prefix, av[1 ]));if (is_directory (dst.buf))/* * keep going, dst will be appended after we get the
worktree.c +8 -5
@@ -311,8 +311,8 @@ static int report(int quiet, const char *fmt, ...)int validate_worktree (const struct worktree *wt,int quiet) {struct strbuf sb =STRBUF_INIT ; -const char *path; -int err; +char *path; +int err, ret;if (is_main_worktree (wt)) {/*
@@ -344,14 +344,17 @@ int validate_worktree(const struct worktree *wt, int quiet)return report (quiet,_ ("'%s/.git' does not exist" ), wt->path); } - path =read_gitfile_gently (sb.buf, &err); + path =xstrdup_or_null (read_gitfile_gently (sb.buf, &err));strbuf_release (&sb);if (!path)return report (quiet,_ ("'%s/.git' is not a .git file, error code %d" ), wt->path, err); -if (fspathcmp (path,real_path (git_common_path ("worktrees/%s" , wt->id)))) -return report (quiet,_ ("'%s' does not point back to" ), + ret =fspathcmp (path,real_path (git_common_path ("worktrees/%s" , wt->id))); +free (path); + +if (ret) +return report (quiet,_ ("'%s' does not point back to '%s'" ), wt->path,git_common_path ("worktrees/%s" , wt->id));return 0 ;
Nguyễn Thái Ngọc Duy (6):
worktree.c: add validate_worktree() worktree.c: add update_worktree_location() worktree move: new command
worktree move: accept destination as directory worktree move: refuse to move worktrees with submodules worktree remove: new command
Documentation/git-worktree.txt | 28 +++--- builtin/worktree.c | 160 +++++++++++++++++++++++++++++++++ contrib/completion/git-completion.bash | 5 +- t/t2028-worktree-move.sh | 57 ++++++++++++ worktree.c | 87 ++++++++++++++++++ worktree.h | 11 +++ 6 files changed, 337 insertions(+), 11 deletions(-)
Signature · 1 line
2.11.0.157.gd943d85