(t *testing.T)
| 275 | } |
| 276 | |
| 277 | func TestRemove(t *testing.T) { |
| 278 | t.Parallel() |
| 279 | dir := bootstrapRepo(t) |
| 280 | |
| 281 | wt, err := Create(t.Context(), dir, "gone", WithRoot(t.TempDir())) |
| 282 | require.NoError(t, err) |
| 283 | require.DirExists(t, wt.Dir) |
| 284 | |
| 285 | require.NoError(t, wt.Remove(t.Context())) |
| 286 | assert.NoDirExists(t, wt.Dir) |
| 287 | |
| 288 | // The branch must be gone too. |
| 289 | branches := gitOut(t, dir, "branch", "--list", wt.Branch) |
| 290 | assert.Empty(t, branches) |
| 291 | } |
| 292 | |
| 293 | func TestRemoveDiscardsDirtyWork(t *testing.T) { |
| 294 | t.Parallel() |