git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 00/11] nd/worktree-move update

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Feb 2, 2017, 08:49 UTC
Message-ID
<20170202085007.21418-1-pclouds@gmail.com>
This squashes two changes from Johannes and Ramsay:
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 339c622e20..a1c91f1542 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -528,7 +528,7 @@ static int unlock_worktree(int ac, const char **av, const char *prefix)
 
 static void validate_no_submodules(const struct worktree *wt)
 {
-	struct index_state istate = {0};
+	struct index_state istate = { NULL };
 	int i, found_submodules = 0;
 
 	if (read_index_from(&istate, worktree_git_path(wt, "index")) > 0) {
diff --git a/t/t2028-worktree-move.sh b/t/t2028-worktree-move.sh
index 084acc6c6d..b3105eaaed 100755
--- a/t/t2028-worktree-move.sh
+++ b/t/t2028-worktree-move.sh
@@ -71,13 +71,14 @@ test_expect_success 'move locked worktree' '
 '
 
 test_expect_success 'move worktree' '
+	toplevel="$(pwd)" &&
 	git worktree move source destination &&
 	test_path_is_missing source &&
 	git worktree list --porcelain | grep "^worktree" >actual &&
 	cat <<-EOF >expected &&
-	worktree $TRASH_DIRECTORY
-	worktree $TRASH_DIRECTORY/destination
-	worktree $TRASH_DIRECTORY/elsewhere
+	worktree $toplevel
+	worktree $toplevel/destination
+	worktree $toplevel/elsewhere
 	EOF
 	test_cmp expected actual &&
 	git -C destination log --format=%s >actual2 &&


Nguyễn Thái Ngọc Duy (11):
  worktree.c: zero new 'struct worktree' on allocation
  worktree: reorder an if statement
  get_worktrees() must return main worktree as first item even on error
  worktree.c: get_worktrees() takes a new flag argument
  worktree list: keep the list sorted
  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 ++++--
 branch.c                               |   2 +-
 builtin/branch.c                       |   2 +-
 builtin/worktree.c                     | 176 +++++++++++++++++++++++++++++++--
 contrib/completion/git-completion.bash |   5 +-
 t/t2027-worktree-list.sh               |  40 ++++++++
 t/t2028-worktree-move.sh               |  57 +++++++++++
 worktree.c                             | 126 +++++++++++++++++++----
 worktree.h                             |  15 ++-
 9 files changed, 410 insertions(+), 41 deletions(-)
-- 
2.11.0.157.gd943d85
Next: Nguyễn Thái Ngọc Duy
Message 1 of 25 in “nd/worktree-move update”
  1. 00/11 nd/worktree-move updateNguyễn Thái Ngọc Duy, Feb 2, 2017
  2. 01/11 worktree.c: zero new 'struct worktree' on allocationNguyễn Thái Ngọc Duy, Feb 2, 2017
  3. 02/11 worktree: reorder an if statementNguyễn Thái Ngọc Duy, Feb 2, 2017
  4. 03/11 get_worktrees() must return main worktree as first item even on errorNguyễn Thái Ngọc Duy, Feb 2, 2017
  5. 05/11 worktree list: keep the list sortedNguyễn Thái Ngọc Duy, Feb 2, 2017
  6. 04/11 worktree.c: get_worktrees() takes a new flag argumentNguyễn Thái Ngọc Duy, Feb 2, 2017
  7. 06/11 worktree.c: add validate_worktree()Nguyễn Thái Ngọc Duy, Feb 2, 2017
  8. 08/11 worktree move: new commandNguyễn Thái Ngọc Duy, Feb 2, 2017
  9. 07/11 worktree.c: add update_worktree_location()Nguyễn Thái Ngọc Duy, Feb 2, 2017
  10. 09/11 worktree move: accept destination as directoryNguyễn Thái Ngọc Duy, Feb 2, 2017
  11. 11/11 worktree remove: new commandNguyễn Thái Ngọc Duy, Feb 2, 2017
  12. 10/11 worktree move: refuse to move worktrees with submodulesNguyễn Thái Ngọc Duy, Feb 2, 2017
  13. Johannes SchindelinFeb 2, 2017
  14. Duy NguyenFeb 2, 2017
  15. Johannes SchindelinFeb 2, 2017
  16. Duy NguyenFeb 2, 2017
  17. Johannes SchindelinFeb 2, 2017
  18. Duy NguyenFeb 2, 2017
  19. Johannes SchindelinFeb 2, 2017
  20. Johannes SchindelinFeb 2, 2017
  21. Junio C HamanoFeb 2, 2017
  22. Duy NguyenFeb 3, 2017
  23. Junio C HamanoFeb 3, 2017
  24. Junio C HamanoFeb 3, 2017
  25. Duy NguyenFeb 4, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.