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

Function setupRemoteAndClone

runtime/pkg/gitutil/gitcmdwrapper_test.go:378–388  ·  view source on GitHub ↗

setupRemoteAndClone creates a remote repository with a single commit on `main` and clones it into a separate local directory. It returns the remote and local paths.

(t *testing.T)

Source from the content-addressed store, hash-verified

376// setupRemoteAndClone creates a remote repository with a single commit on `main`
377// and clones it into a separate local directory. It returns the remote and local paths.
378func setupRemoteAndClone(t *testing.T) (string, string) {
379 remote := setupTestRepository(t)
380 local := t.TempDir()
381 // t.TempDir() pre-creates the directory; remove it so `git clone` can populate it.
382 require.NoError(t, os.RemoveAll(local))
383
384 err := Clone(context.Background(), local, remote, "main", false, false)
385 require.NoError(t, err)
386 setupGitConfig(t, local)
387 return remote, local
388}
389
390func execGit(repoPath string, args ...string) error {
391 cmd := exec.Command("git", append([]string{"-C", repoPath}, args...)...)

Callers 1

TestFetchBranchesFunction · 0.85

Calls 4

setupTestRepositoryFunction · 0.70
CloneFunction · 0.70
setupGitConfigFunction · 0.70
TempDirMethod · 0.65

Tested by

no test coverage detected