MCPcopy Index your code
hub / github.com/rilldata/rill / TestCommitAndSafePush_NoRemoteCommits

Function TestCommitAndSafePush_NoRemoteCommits

cli/pkg/cmdutil/helper_test.go:26–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24}
25
26func TestCommitAndSafePush_NoRemoteCommits(t *testing.T) {
27 tempDir, _ := setupTestRepository(t)
28 h := minimalHelper()
29
30 // Create local changes
31 createCommit(t, tempDir, "new-file.txt", "new content", "add new file")
32
33 config := &gitutil.Config{
34 Remote: filepath.Join(tempDir, ".git"),
35 DefaultBranch: getCurrentBranch(t, tempDir),
36 Subpath: "",
37 }
38
39 err := h.CommitAndSafePush(context.Background(), tempDir, config, "test commit", author, "1")
40 require.NoError(t, err, "CommitAndSafePush should succeed with no remote commits")
41 // verify file exists locally and was pushed
42 assertFileExists(t, tempDir, "new-file.txt")
43}
44
45func TestCommitAndSafePush_WithRemoteCommits_DefaultChoice1(t *testing.T) {
46 tempDir, remoteDir := setupTestRepository(t)

Callers

nothing calls this directly

Calls 6

minimalHelperFunction · 0.85
CommitAndSafePushMethod · 0.80
setupTestRepositoryFunction · 0.70
createCommitFunction · 0.70
getCurrentBranchFunction · 0.70
assertFileExistsFunction · 0.70

Tested by

no test coverage detected