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

Function TestE2EGitCommitModifyTrackedFile

e2e_git_test.go:304–327  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

302 assertGitStatus(t, repo.mountPath, map[string]string{
303 "packages/wrangler/bin/run.sh -> packages/wrangler-renamed/bin/run.sh": "R ",
304 "packages/wrangler/manifest-link -> packages/wrangler-renamed/manifest-link": "R ",
305 "packages/wrangler/nested/deep/config.json -> packages/wrangler-renamed/nested/deep/config.json": "R ",
306 "packages/wrangler/package.json -> packages/wrangler-renamed/package.json": "R ",
307 "packages/wrangler/src/index.js -> packages/wrangler-renamed/src/index.js": "R ",
308 })
309
310 gitCmd(t, repo.mountPath,
311 "-c", "user.name=E2E Test",
312 "-c", "user.email=e2e@test",
313 "commit", "-m", "rename tracked directory",
314 )
315 waitForHeadAndStatus(t, repo.mountPath, previousHead, map[string]string{})
316 waitForOverlayClean(t, repo)
317 assertPathMissing(t, filepath.Join(repo.mountPath, "packages", "wrangler"))
318 if got := readFileStr(t, renamedManifest); !strings.Contains(got, `"name":"wrangler"`) {
319 t.Fatalf("renamed package manifest after reconcile = %q", got)
320 }
321 assertPathExists(t, filepath.Join(renamedRoot, "nested", "deep", "config.json"))
322 assertPathExists(t, filepath.Join(renamedRoot, "bin", "run.sh"))
323}
324
325func TestE2EGitCheckoutBranchSwitch(t *testing.T) {
326 repo := newMountedE2ERepo(t)
327
328 mainReadme := readFileEventually(t, filepath.Join(repo.mountPath, "README.md"))
329 gitCmd(t, repo.mountPath, "checkout", "-b", "feature")
330 if err := os.WriteFile(filepath.Join(repo.mountPath, "README.md"), []byte(mainReadme+"feature branch line\n"), 0o644); err != nil {

Callers

nothing calls this directly

Calls 7

newMountedE2ERepoFunction · 0.85
readFileEventuallyFunction · 0.85
gitCmdFunction · 0.85
waitForHeadAndStatusFunction · 0.85
readFileStrFunction · 0.85
JoinMethod · 0.80
WriteFileMethod · 0.65

Tested by

no test coverage detected