Add some error checks

This commit is contained in:
J. David Ibáñez
2014-07-15 21:10:51 +02:00
parent b65d3e6db5
commit 794e82c799
2 changed files with 8 additions and 4 deletions

View File

@@ -250,7 +250,8 @@ class Config(object):
@staticmethod
def parse_bool(text):
res = ffi.new('int *')
C.git_config_parse_bool(res, to_str(text))
err = C.git_config_parse_bool(res, to_str(text))
check_error(err)
return res[0] != 0

View File

@@ -171,7 +171,8 @@ class Remote(object):
@url.setter
def url(self, value):
C.git_remote_set_url(self._remote, to_str(value))
err = C.git_remote_set_url(self._remote, to_str(value))
check_error(err)
@property
def push_url(self):
@@ -263,14 +264,16 @@ class Remote(object):
Add a fetch refspec to the remote"""
C.git_remote_add_fetch(self._remote, to_str(spec))
err = C.git_remote_add_fetch(self._remote, to_str(spec))
check_error(err)
def add_push(self, spec):
"""add_push(refspec)
Add a push refspec to the remote"""
C.git_remote_add_push(self._remote, to_str(spec))
err = C.git_remote_add_push(self._remote, to_str(spec))
check_error(err)
@ffi.callback("int (*cb)(const char *ref, const char *msg, void *data)")
def _push_cb(ref, msg, data):