-
-
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
Add Close() method to gogitRepository #8901
Changes from 6 commits
6826214
9dbae6e
384537c
a057029
2ec2a41
2e161f8
ae9b4a8
0334a1f
813faad
18c3137
c1e6251
623a2e1
521dac1
f6ab132
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ func GetTagsByPath(path string) ([]*git.Tag, error) { | |
if err != nil { | ||
return nil, err | ||
} | ||
defer gitRepo.Close() | ||
|
||
return gitRepo.GetTagInfos() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be a problem since Tag contains a reference to Repository.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably is. I'll take another look. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh dear GetTagInfos is a terrible implementation. It needs rewriting... |
||
} | ||
|
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.
How about add
MockContext.Close
and close repository there?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.
We would need to add a Close() to context.Context as MockContext actually produces a real context.