summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-07-05 15:51:01 -0400
committerGitHub <noreply@github.com>2016-07-05 15:51:01 -0400
commitc18a2bc4e013c07c497e9811f1d796852773d348 (patch)
treea991aedcf10c6e58c01c3206cb2371fcefca0365 /tests
parentb57c176aa94275e539b6673a3fef0bdfaa227e00 (diff)
parentf1dba144810b190bc7c621a346f537e1f646b75a (diff)
downloadlibgit2-c18a2bc4e013c07c497e9811f1d796852773d348.tar.gz
Merge pull request #3851 from txdv/get-user-agent
Add get user agent functionality.
Diffstat (limited to 'tests')
-rw-r--r--tests/core/useragent.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/core/useragent.c b/tests/core/useragent.c
index 6d06693a8..5c09223bb 100644
--- a/tests/core/useragent.c
+++ b/tests/core/useragent.c
@@ -4,8 +4,14 @@
void test_core_useragent__get(void)
{
const char *custom_name = "super duper git";
+ git_buf buf = GIT_BUF_INIT;
cl_assert_equal_p(NULL, git_libgit2__user_agent());
cl_git_pass(git_libgit2_opts(GIT_OPT_SET_USER_AGENT, custom_name));
cl_assert_equal_s(custom_name, git_libgit2__user_agent());
+
+ cl_git_pass(git_libgit2_opts(GIT_OPT_GET_USER_AGENT, &buf));
+ cl_assert_equal_s(custom_name, buf.ptr);
+
+ git_buf_free(&buf);
}