File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -114,3 +114,37 @@ teardown() {
114114 assert_worktree_not_exists " $TEST_DIR /destroy-by-name"
115115 assert_branch_not_exists " destroy-by-name"
116116}
117+
118+ @test " destroy: resolves worktree by relative path" {
119+ init_repo myrepo
120+ cd myrepo
121+ create_worktree ../destroy-rel destroy-rel
122+
123+ echo " y" | " $GIT_WT " destroy ../destroy-rel
124+
125+ assert_worktree_not_exists " $TEST_DIR /destroy-rel"
126+ assert_branch_not_exists " destroy-rel"
127+ }
128+
129+ @test " destroy: resolves multiple worktrees by name" {
130+ init_repo myrepo
131+ cd myrepo
132+ create_worktree ../dest-name-one dest-name-one
133+ create_worktree ../dest-name-two dest-name-two
134+
135+ echo " y" | " $GIT_WT " destroy dest-name-one dest-name-two
136+
137+ assert_worktree_not_exists " $TEST_DIR /dest-name-one"
138+ assert_worktree_not_exists " $TEST_DIR /dest-name-two"
139+ }
140+
141+ @test " destroy: invalid name lists available worktrees" {
142+ init_repo myrepo
143+ cd myrepo
144+ create_worktree ../some-dest some-dest
145+
146+ run " $GIT_WT " destroy no-such-wt
147+ [ " $status " -ne 0 ]
148+ [[ " $output " == * " Available worktrees:" * ]]
149+ [[ " $output " == * " some-dest" * ]]
150+ }
You can’t perform that action at this time.
0 commit comments