FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add get user agent functionality. by txdv · Pull Request #3851 · libgit2/libgit2 · GitHub

Repository navigation

Add get user agent functionality. - #3851

Merged
ethomson merged 1 commit into
libgit2:masterfrom
txdv:get-user-agent
Jul 5, 2016
Merged

ethomson merged 1 commit into
libgit2:masterfrom
txdv:get-user-agent

Conversation

txdv commented Jul 5, 2016 •
edited
Loading

Copy link
Copy Markdown
Contributor

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.

Comment thread tests/core/useragent.c
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);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please add a git_buf_free(&buf) here to free the memory.

ethomson commented Jul 5, 2016

Copy link
Copy Markdown
Member

This is great to have, thanks for adding this. I added two comments inline.

txdv commented Jul 5, 2016

Copy link
Copy Markdown
Contributor Author

I added the freeing at the end, not directly on the line, so it frees but the comment is still shown.

ethomson commented Jul 5, 2016

Copy link
Copy Markdown
Member

Perfect, can you squash this down into a single commit and then I'll merge it! 😀

txdv force-pushed the get-user-agent branch from a0d8144 to a3338ef Compare July 5, 2016 15:02

txdv commented Jul 5, 2016

Copy link
Copy Markdown
Contributor Author

Your wish is my desire. Is there a place to document this added functionality?

ethomson commented Jul 5, 2016

Copy link
Copy Markdown
Member

Yes, thanks for reminding me! Please add this to the CHANGELOG.md. :D

txdv force-pushed the get-user-agent branch from a3338ef to f1dba14 Compare July 5, 2016 15:10
Comment thread CHANGELOG.md

* 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`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

👍

ethomson commented Jul 5, 2016

Copy link
Copy Markdown
Member

Awesome, thanks again! ✨

ethomson merged commit c18a2bc into libgit2:master Jul 5, 2016
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL