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

Function TestCommitAndSafePush_WithSubpath

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

Source from the content-addressed store, hash-verified

156}
157
158func TestCommitAndSafePush_WithSubpath(t *testing.T) {
159 tempDir, remoteDir := setupMonorepoTestRepository(t)
160 h := minimalHelper()
161
162 // Create local changes in subproject1 (uncommitted)
163 createFile(t, tempDir, "subproject1/local.txt", "local content")
164
165 // Create remote changes in subproject1
166 createRemoteCommit(t, remoteDir, "subproject1/remote.txt", "remote content", "add remote file to subproject1")
167
168 config := &gitutil.Config{
169 Remote: remoteDir,
170 DefaultBranch: getCurrentBranch(t, tempDir),
171 Subpath: "subproject1",
172 }
173
174 err := h.CommitAndSafePush(context.Background(), tempDir, config, "test commit", author, "1")
175 require.NoError(t, err, "CommitAndSafePush should succeed with subpath")
176
177 // Verify both files exist in subproject1
178 assertFileExists(t, tempDir, "subproject1/local.txt")
179 assertFileExists(t, tempDir, "subproject1/remote.txt")
180}
181
182func TestCommitAndSafePush_SubpathIsolation(t *testing.T) {
183 tempDir, remoteDir := setupMonorepoTestRepository(t)

Callers

nothing calls this directly

Calls 7

minimalHelperFunction · 0.85
CommitAndSafePushMethod · 0.80
createFileFunction · 0.70
createRemoteCommitFunction · 0.70
getCurrentBranchFunction · 0.70
assertFileExistsFunction · 0.70

Tested by

no test coverage detected