Add get user agent functionality.#3851
Merged
Merged
Conversation
| cl_assert_equal_s(custom_name, git_libgit2__user_agent()); | ||
|
|
||
| git_libgit2_opts(GIT_OPT_GET_USER_AGENT, &buf); | ||
| cl_assert_equal_s(custom_name, buf.ptr); |
Member
There was a problem hiding this comment.
Please add a git_buf_free(&buf) here to free the memory.
Member
|
This is great to have, thanks for adding this. I added two comments inline. |
Contributor
Author
|
I added the freeing at the end, not directly on the line, so it frees but the comment is still shown. |
Member
|
Perfect, can you squash this down into a single commit and then I'll merge it! 😀 |
Contributor
Author
|
Your wish is my desire. Is there a place to document this added functionality? |
Member
|
Yes, thanks for reminding me! Please add this to the |
|
|
||
| * You can now get the user-agent used by libgit2 using the | ||
| `GIT_OPT_GET_USER_AGENT` option with `git_libgit2_opts()`. | ||
| It is the counterpart to `GIT_OPT_SET_USER_AGENT`. |
Member
|
Awesome, thanks again! ✨ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When exposing the set user agent functionality in the C# binding we saw that we can't really write a good test for whether we set it correctly since getting the set user agent is not possible.
This adds the possibility to get the user agent.