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

Function TestClientHasLocalBranchFindsExistingBranch

git/client_test.go:980–990  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

978}
979
980func TestClientHasLocalBranchFindsExistingBranch(t *testing.T) {
981 // Given a repository with a trunk commit
982 repo := newTestRepo(t)
983 repo.run(t, "commit", "--quiet", "--allow-empty", "-m", "initial commit")
984
985 // When the local branch is checked
986 exists := repo.client.HasLocalBranch(t.Context(), "trunk")
987
988 // Then the branch is found
989 assert.True(t, exists, "trunk should resolve as a local branch")
990}
991
992func TestClientHasLocalBranchRejectsMissingBranch(t *testing.T) {
993 // Given a repository without a feature branch

Callers

nothing calls this directly

Calls 3

newTestRepoFunction · 0.85
HasLocalBranchMethod · 0.65
runMethod · 0.45

Tested by

no test coverage detected