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

Function TestStatusDetectsModified

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

Source from the content-addressed store, hash-verified

240}
241
242func TestStatusDetectsModified(t *testing.T) {
243 t.Parallel()
244 dir := bootstrapRepo(t)
245
246 wt, err := Create(t.Context(), dir, "modified", WithRoot(t.TempDir()))
247 require.NoError(t, err)
248 require.NoError(t, os.WriteFile(filepath.Join(wt.Dir, "a.txt"), []byte("changed"), 0o644))
249
250 st, err := wt.Status(t.Context())
251 require.NoError(t, err)
252 assert.True(t, st.IsDirty())
253 assert.True(t, st.Modified)
254 assert.False(t, st.Untracked)
255 assert.False(t, st.NewCommits)
256}
257
258func TestStatusDetectsNewCommits(t *testing.T) {
259 t.Parallel()

Callers

nothing calls this directly

Calls 6

CreateFunction · 0.85
WithRootFunction · 0.85
ContextMethod · 0.80
StatusMethod · 0.80
IsDirtyMethod · 0.80
bootstrapRepoFunction · 0.70

Tested by

no test coverage detected