MCPcopy Index your code
hub / github.com/docker/docker-agent / TestRemove

Function TestRemove

pkg/worktree/worktree_test.go:277–291  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

275}
276
277func 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
293func TestRemoveDiscardsDirtyWork(t *testing.T) {
294 t.Parallel()

Callers

nothing calls this directly

Calls 6

CreateFunction · 0.85
WithRootFunction · 0.85
gitOutFunction · 0.85
ContextMethod · 0.80
bootstrapRepoFunction · 0.70
RemoveMethod · 0.45

Tested by

no test coverage detected