MCPcopy
hub / github.com/nektos/act / TestFindGitRemoteURL

Function TestFindGitRemoteURL

pkg/common/git/git_test.go:76–100  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func TestFindGitRemoteURL(t *testing.T) {
77 assert := assert.New(t)
78
79 basedir := testDir(t)
80 gitConfig()
81 err := gitCmd("init", basedir)
82 assert.NoError(err)
83 err = cleanGitHooks(basedir)
84 assert.NoError(err)
85
86 remoteURL := "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/my-repo-name"
87 err = gitCmd("-C", basedir, "remote", "add", "origin", remoteURL)
88 assert.NoError(err)
89
90 u, err := findGitRemoteURL(context.Background(), basedir, "origin")
91 assert.NoError(err)
92 assert.Equal(remoteURL, u)
93
94 remoteURL = "git@github.com/AwesomeOwner/MyAwesomeRepo.git"
95 err = gitCmd("-C", basedir, "remote", "add", "upstream", remoteURL)
96 assert.NoError(err)
97 u, err = findGitRemoteURL(context.Background(), basedir, "upstream")
98 assert.NoError(err)
99 assert.Equal(remoteURL, u)
100}
101
102func TestGitFindRef(t *testing.T) {
103 basedir := testDir(t)

Callers

nothing calls this directly

Calls 5

testDirFunction · 0.85
gitConfigFunction · 0.85
gitCmdFunction · 0.85
cleanGitHooksFunction · 0.85
findGitRemoteURLFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…