Skip to content

TestRepository_GetTag intermittently panics due to an NPE #18043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion modules/git/repo_tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ func TestRepository_GetTag(t *testing.T) {
aTagID, _ := bareRepo1.GetTagID(aTagName)

lTag, err := bareRepo1.GetTag(lTagName)
lTag.repo = nil
assert.NoError(t, err)
assert.NotNil(t, lTag)
if lTag == nil {
assert.FailNow(t, "nil lTag: %s", lTagName)
}
lTag.repo = nil
assert.EqualValues(t, lTagName, lTag.Name)
assert.EqualValues(t, lTagCommitID, lTag.ID.String())
assert.EqualValues(t, lTagCommitID, lTag.Object.String())
Expand All @@ -61,6 +64,9 @@ func TestRepository_GetTag(t *testing.T) {
aTag, err := bareRepo1.GetTag(aTagName)
assert.NoError(t, err)
assert.NotNil(t, aTag)
if aTag == nil {
assert.FailNow(t, "nil aTag: %s", aTagName)
}
assert.EqualValues(t, aTagName, aTag.Name)
assert.EqualValues(t, aTagID, aTag.ID.String())
assert.NotEqual(t, aTagID, aTag.Object.String())
Expand Down