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

Function TestWithRepoDirReplacesExistingRepository

git/command_test.go:77–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

75}
76
77func TestWithRepoDirReplacesExistingRepository(t *testing.T) {
78 // Given a Git command already scoped to a repository
79 command := &Command{exec.Command("git", "-C", "old/repo", "status")}
80
81 // When its repository directory is changed
82 WithRepoDir("new/repo")(command)
83
84 // Then the existing repository value is replaced without adding another option
85 assert.Equal(t, []string{"git", "-C", "new/repo", "status"}, command.Args)
86}

Callers

nothing calls this directly

Calls 3

WithRepoDirFunction · 0.85
CommandMethod · 0.80
EqualMethod · 0.80

Tested by

no test coverage detected