(t *testing.T, dir string)
| 405 | func TestE2EGitCheckoutRestorePath(t *testing.T) { |
| 406 | repo := newMountedE2ERepo(t) |
| 407 | |
| 408 | readmePath := filepath.Join(repo.mountPath, "README.md") |
| 409 | readmeOrig := readFileEventually(t, readmePath) |
| 410 | if err := os.WriteFile(readmePath, []byte(readmeOrig+"local change\n"), 0o644); err != nil { |
| 411 | t.Fatal(err) |
| 412 | } |
| 413 | assertGitStatus(t, repo.mountPath, map[string]string{"README.md": " M"}) |
| 414 | |
| 415 | gitCmd(t, repo.mountPath, "checkout", "--", "README.md") |
| 416 | assertGitStatus(t, repo.mountPath, map[string]string{}) |
| 417 | if got := readFileStr(t, readmePath); got != readmeOrig { |
| 418 | t.Fatalf("README.md after checkout -- = %q, want original content", got) |
| 419 | } |
| 420 | } |
| 421 | |
| 422 | func TestE2EGitMergeAndRebase(t *testing.T) { |
| 423 | repo := newMountedE2ERepo(t) |
| 424 | |
| 425 | gitCmd(t, repo.mountPath, "checkout", "-b", "feature") |
| 426 | writeTestFile(t, repo.mountPath, "FEATURE.md", "feature\n") |
| 427 | gitCmd(t, repo.mountPath, "add", "FEATURE.md") |
| 428 | gitCmd(t, repo.mountPath, |
no test coverage detected