MCPcopy Create free account
hub / github.com/cli/cli / initSyncTestRepo

Function initSyncTestRepo

pkg/cmd/repo/sync/sync_test.go:111–119  ·  view source on GitHub ↗

initSyncTestRepo creates a fresh git repository on branch "trunk" with an isolated config and a configured identity, returning its directory.

(t *testing.T)

Source from the content-addressed store, hash-verified

109// initSyncTestRepo creates a fresh git repository on branch "trunk" with an
110// isolated config and a configured identity, returning its directory.
111func initSyncTestRepo(t *testing.T) string {
112 t.Helper()
113 git.IsolateConfig(t)
114 repoDir := t.TempDir()
115 runGit(t, repoDir, "init", "--quiet", "--initial-branch=trunk")
116 runGit(t, repoDir, "config", "user.name", "Test User")
117 runGit(t, repoDir, "config", "user.email", "test@example.com")
118 return repoDir
119}
120
121func TestExecuteLocalRepoSyncNonCurrentBranch(t *testing.T) {
122 t.Run("branch checked out in another worktree", func(t *testing.T) {

Calls 3

IsolateConfigFunction · 0.92
runGitFunction · 0.85
HelperMethod · 0.65

Tested by

no test coverage detected