]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'rs/worktree-list-verbose'
authorJunio C Hamano <gitster@pobox.com>
Wed, 10 Feb 2021 22:48:32 +0000 (14:48 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Feb 2021 22:48:32 +0000 (14:48 -0800)
`git worktree list` now annotates worktrees as prunable, shows
locked and prunable attributes in --porcelain mode, and gained
a --verbose option.

* rs/worktree-list-verbose:
  worktree: teach `list` verbose mode
  worktree: teach `list` to annotate prunable worktree
  worktree: teach `list --porcelain` to annotate locked worktree
  t2402: ensure locked worktree is properly cleaned up
  worktree: teach worktree_lock_reason() to gently handle main worktree
  worktree: teach worktree to lazy-load "prunable" reason
  worktree: libify should_prune_worktree()

1  2 
t/t2402-worktree-list.sh

index 821a20f3d6334efcaf32afda14083c6717610a3e,39a339e636638e8dede523f645993cd531735f61..42d35d9ae82f5e3084d1cc37512718565aa6c41a
@@@ -66,9 -63,10 +66,10 @@@ test_expect_success '"list" all worktre
  
  test_expect_success '"list" all worktrees with locked annotation' '
        test_when_finished "rm -rf locked unlocked out && git worktree prune" &&
 -      git worktree add --detach locked master &&
 -      git worktree add --detach unlocked master &&
 +      git worktree add --detach locked main &&
 +      git worktree add --detach unlocked main &&
        git worktree lock locked &&
+       test_when_finished "git worktree unlock locked" &&
        git worktree list >out &&
        grep "/locked  *[0-9a-f].* locked$" out &&
        ! grep "/unlocked  *[0-9a-f].* locked$" out