Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
fb96b28c
Commit
fb96b28c
authored
Feb 23, 2016
by
Vicent Marti
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3629 from ethomson/set_user_agent_doc
git_libgit2_opts: minor documentation & usage fixes
parents
305c4f95
7bab2e8f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
include/git2/common.h
+6
-0
src/settings.c
+3
-0
tests/core/opts.c
+6
-0
No files found.
include/git2/common.h
View file @
fb96b28c
...
...
@@ -245,6 +245,12 @@ typedef enum {
*
* * opts(GIT_OPT_SET_USER_AGENT, const char *user_agent)
*
* > Set the value of the User-Agent header. This value will be
* > appended to "git/1.0", for compatibility with other git clients.
* >
* > - `user_agent` is the value that will be delivered as the
* > User-Agent header on HTTP requests.
*
* @param option Option key
* @param ... value to set the option
* @return 0 on success, <0 on failure
...
...
src/settings.c
View file @
fb96b28c
...
...
@@ -181,6 +181,9 @@ int git_libgit2_opts(int key, ...)
}
break
;
default:
giterr_set
(
GITERR_INVALID
,
"invalid option key"
);
error
=
-
1
;
}
va_end
(
ap
);
...
...
tests/core/opts.c
View file @
fb96b28c
...
...
@@ -17,3 +17,9 @@ void test_core_opts__readwrite(void)
cl_assert
(
new_val
==
old_val
);
}
void
test_core_opts__invalid_option
(
void
)
{
cl_git_fail
(
git_libgit2_opts
(
-
1
,
"foobar"
));
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment