Permalink
Browse files

Add del operator to delete variable to Config

  • Loading branch information...
1 parent 415a9d3 commit 218e443d557283509e2d54ed66ad75bd2ba41da3 @miri64 committed May 4, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 pygit2.c
View
@@ -2795,7 +2795,9 @@ Config_setitem(Config *self, PyObject *py_key, PyObject *py_value)
int err;
const char *c_key = PyString_AsString(py_key);
- if (PyBool_Check(py_value)) {
+ if (!py_value) {
+ err = git_config_delete(self->config, c_key);
+ } else if (PyBool_Check(py_value)) {
err = git_config_set_bool(self->config, c_key,
(int)PyObject_IsTrue(py_value));
} else if (PyInt_Check(py_value)) {

0 comments on commit 218e443

Please sign in to comment.