-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
mirror: Delete tags in mirror which are removed for original repo. #5609
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5609 +/- ##
==========================================
+ Coverage 37.51% 37.81% +0.29%
==========================================
Files 322 322
Lines 47458 47458
==========================================
+ Hits 17804 17946 +142
+ Misses 27097 26926 -171
- Partials 2557 2586 +29
Continue to review full report at Codecov.
|
88a582d
to
efa57ea
Compare
This bug was being caused by an error in the logic in `release.go`. Credit to @yasuokav for tracing the root of the issue. Fixes: go-gitea#5192.
efa57ea
to
be09984
Compare
@HarshitOnGitHub Thanks for another PR 😄 Best wishes for the new year 🎉 |
Same to you @techknowlogick and to the whole team of gitea. :) |
return fmt.Errorf("GetTagCommitID: %v", err) | ||
} | ||
if !gitRepo.IsTagExist(rel.TagName) || commitID != rel.Sha1 { | ||
if git.IsErrNotExist(err) || commitID != rel.Sha1 { |
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.
These two condition are different. If git.IsErrNotExist(err)
, it should be delted. But for commitID != rel.Sha
, the tag should be retag but not delete.
return fmt.Errorf("GetTagCommitID: %v", err) | ||
} | ||
if !gitRepo.IsTagExist(rel.TagName) || commitID != rel.Sha1 { | ||
if git.IsErrNotExist(err) || commitID != rel.Sha1 { |
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.
These two condition are different. If git.IsErrNotExist(err)
, it should be delted. But for commitID != rel.Sha
, the tag should be retag but not delete.
Up, could we have a feedback or a patch for #6237 from you @HarshitOnGitHub ? Bye 👋 |
This bug was being caused by an error in the logic in
release.go
.Credit to @yasuokav for tracing the root of the issue.
I have tested the changes manually as well as added an automated test.
Fixes: #5192.