MCPcopy Create free account
hub / github.com/cloudflare/artifact-fs / waitForCondition

Function waitForCondition

e2e_git_test.go:509–522  ·  view source on GitHub ↗
(t *testing.T, timeout time.Duration, description string, fn func() (bool, string))

Source from the content-addressed store, hash-verified

507}
508
509func TestE2EGitCommitPreservesUnstagedAfterStagedCommit(t *testing.T) {
510 repo := newMountedE2ERepo(t)
511
512 readmePath := filepath.Join(repo.mountPath, "README.md")
513 base := readFileEventually(t, readmePath)
514 staged := base + "staged line\n"
515 worktree := staged + "unstaged line\n"
516 if err := os.WriteFile(readmePath, []byte(staged), 0o644); err != nil {
517 t.Fatal(err)
518 }
519 gitCmd(t, repo.mountPath, "add", "README.md")
520 if err := os.WriteFile(readmePath, []byte(worktree), 0o644); err != nil {
521 t.Fatal(err)
522 }
523 assertGitStatus(t, repo.mountPath, map[string]string{"README.md": "MM"})
524
525 preCommitHEAD := strings.TrimSpace(gitCmd(t, repo.mountPath, "rev-parse", "HEAD"))

Calls 1

AddMethod · 0.80

Tested by

no test coverage detected