We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5bc93ea commit 7bab2e8Copy full SHA for 7bab2e8
src/settings.c
@@ -181,6 +181,9 @@ int git_libgit2_opts(int key, ...)
181
}
182
183
break;
184
+ default:
185
+ giterr_set(GITERR_INVALID, "invalid option key");
186
+ error = -1;
187
188
189
va_end(ap);
tests/core/opts.c
@@ -17,3 +17,9 @@ void test_core_opts__readwrite(void)
17
18
cl_assert(new_val == old_val);
19
20
+
21
+void test_core_opts__invalid_option(void)
22
+{
23
+ cl_git_fail(git_libgit2_opts(-1, "foobar"));
24
+}
25
0 commit comments