(t *testing.T, timeout time.Duration, description string, fn func() (bool, string))
| 507 | } |
| 508 | |
| 509 | func 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")) |
no test coverage detected