-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix tag/release deletion #10663
Fix tag/release deletion #10663
Conversation
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #10663 +/- ##
==========================================
- Coverage 43.6% 43.58% -0.02%
==========================================
Files 588 588
Lines 82485 82485
==========================================
- Hits 35965 35954 -11
- Misses 42059 42066 +7
- Partials 4461 4465 +4
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this also needs a revision:
gitea/modules/repofiles/update.go
Lines 702 to 709 in 78728a6
// If is tag reference | |
tagName := opts.TagName() | |
if opts.IsDelRef() { | |
delTags = append(delTags, tagName) | |
} else { | |
cache.Remove(repo.GetCommitsCountCacheKey(tagName, true)) | |
addTags = append(addTags, tagName) | |
} |
Looks like the cache.Remove()
call should be inside the if opts.IsDelRef()
block rather than the else
.
Maybe? I'm not sure, as back in the gitea/modules/repofiles/update.go Lines 573 to 580 in 7e0a5b1
Same in gitea/modules/repofiles/update.go Lines 439 to 454 in 81072af
Of course, that's not to say it isn't a bug that's been around for a while. 😅 |
Yeah, but what could we be having cached about a ref that didn't exist before? Notice it's using I can't follow the code ATM, but it's truly suspicious. 🤔 |
This bug is introduced by #10105. See https://github.com/go-gitea/gitea/pull/10105/files#r389336929 |
Currently you cannot delete a light tag from a repo because deleting a tag is never a "new tag".
git tag test && git push --tags
git tag -d test && git push origin :test