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

Function createRemoteCommit

cli/pkg/gitutil/gitcmdwrapper_test.go:656–671  ·  view source on GitHub ↗
(t *testing.T, remoteDir, fileName, fileContent, commitMessage string)

Source from the content-addressed store, hash-verified

654}
655
656func createRemoteCommit(t *testing.T, remoteDir, fileName, fileContent, commitMessage string) {
657 // Clone the bare repository to a temporary working directory
658 workingDir := t.TempDir()
659 cmd := exec.Command("git", "clone", remoteDir, workingDir)
660 err := cmd.Run()
661 require.NoError(t, err, "failed to clone remote repository")
662 setupGitConfig(t, workingDir)
663
664 // Create and commit the file in the working directory
665 createCommit(t, workingDir, fileName, fileContent, commitMessage)
666
667 // Push the changes back to the remote repository
668 cmd = exec.Command("git", "-C", workingDir, "push", "origin", "HEAD")
669 err = cmd.Run()
670 require.NoError(t, err, "failed to push changes to remote repository")
671}
672
673// createRemoteMergeCommit builds a merge commit on the remote by cloning it,
674// creating a feature branch and a divergent commit, then merging with --no-ff and pushing.

Callers 4

TestRunGitStatusFunction · 0.70
TestGitPullFunction · 0.70
TestRunUpstreamMergeFunction · 0.70

Calls 4

setupGitConfigFunction · 0.70
createCommitFunction · 0.70
TempDirMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected