MCPcopy Create free account
hub / github.com/libgit2/git2go / TestCreateTag

Function TestCreateTag

tag_test.go:9–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestCreateTag(t *testing.T) {
10 t.Parallel()
11 repo := createTestRepo(t)
12 defer cleanupTestRepo(t, repo)
13
14 commitId, _ := seedTestRepo(t, repo)
15
16 commit, err := repo.LookupCommit(commitId)
17 checkFatal(t, err)
18
19 tagId := createTestTag(t, repo, commit)
20
21 tag, err := repo.LookupTag(tagId)
22 checkFatal(t, err)
23
24 compareStrings(t, "v0.0.0", tag.Name())
25 compareStrings(t, "This is a tag", tag.Message())
26 compareStrings(t, commitId.String(), tag.TargetId().String())
27}
28
29func TestCreateTagLightweight(t *testing.T) {
30 t.Parallel()

Callers

nothing calls this directly

Calls 12

createTestRepoFunction · 0.85
cleanupTestRepoFunction · 0.85
seedTestRepoFunction · 0.85
checkFatalFunction · 0.85
createTestTagFunction · 0.85
compareStringsFunction · 0.85
LookupCommitMethod · 0.80
LookupTagMethod · 0.80
TargetIdMethod · 0.80
NameMethod · 0.45
MessageMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…