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

Function TestCreateTagLightweight

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

Source from the content-addressed store, hash-verified

27}
28
29func TestCreateTagLightweight(t *testing.T) {
30 t.Parallel()
31 repo := createTestRepo(t)
32 defer cleanupTestRepo(t, repo)
33
34 commitID, _ := seedTestRepo(t, repo)
35
36 commit, err := repo.LookupCommit(commitID)
37 checkFatal(t, err)
38
39 tagID, err := repo.Tags.CreateLightweight("v0.1.0", commit, false)
40 checkFatal(t, err)
41
42 _, err = repo.Tags.CreateLightweight("v0.1.0", commit, true)
43 checkFatal(t, err)
44
45 ref, err := repo.References.Lookup("refs/tags/v0.1.0")
46 checkFatal(t, err)
47
48 compareStrings(t, "refs/tags/v0.1.0", ref.Name())
49 compareStrings(t, "v0.1.0", ref.Shorthand())
50 compareStrings(t, tagID.String(), commitID.String())
51 compareStrings(t, commitID.String(), ref.Target().String())
52}
53
54func TestListTags(t *testing.T) {
55 t.Parallel()

Callers

nothing calls this directly

Calls 12

createTestRepoFunction · 0.85
cleanupTestRepoFunction · 0.85
seedTestRepoFunction · 0.85
checkFatalFunction · 0.85
compareStringsFunction · 0.85
LookupCommitMethod · 0.80
CreateLightweightMethod · 0.80
ShorthandMethod · 0.80
LookupMethod · 0.45
NameMethod · 0.45
StringMethod · 0.45
TargetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…