(out string)
| 489 | if err := os.WriteFile(readmePath, []byte(updated), 0o644); err != nil { |
| 490 | t.Fatal(err) |
| 491 | } |
| 492 | gitCmd(t, repo.mountPath, "add", "README.md") |
| 493 | preCommitHEAD := strings.TrimSpace(gitCmd(t, repo.mountPath, "rev-parse", "HEAD")) |
| 494 | gitCmd(t, repo.mountPath, |
| 495 | "-c", "user.name=E2E Test", |
| 496 | "-c", "user.email=e2e@test", |
| 497 | "commit", "-m", "modify readme in e2e", |
| 498 | ) |
| 499 | |
| 500 | waitForHeadAndStatus(t, repo.mountPath, preCommitHEAD, map[string]string{}) |
| 501 | if got := readFileStr(t, readmePath); got != updated { |
| 502 | t.Fatalf("README.md after commit = %q", got) |
| 503 | } |
| 504 | if logOut := gitCmd(t, repo.mountPath, "log", "--oneline", "-1"); !strings.Contains(logOut, "modify readme in e2e") { |
| 505 | t.Fatalf("expected commit message in log, got %q", logOut) |
| 506 | } |
| 507 | } |
| 508 | |
| 509 | func TestE2EGitCommitPreservesUnstagedAfterStagedCommit(t *testing.T) { |
| 510 | repo := newMountedE2ERepo(t) |
no outgoing calls
no test coverage detected