Add some error checks
This commit is contained in:
@@ -250,7 +250,8 @@ class Config(object):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_bool(text):
|
def parse_bool(text):
|
||||||
res = ffi.new('int *')
|
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
|
return res[0] != 0
|
||||||
|
|
||||||
|
@@ -171,7 +171,8 @@ class Remote(object):
|
|||||||
|
|
||||||
@url.setter
|
@url.setter
|
||||||
def url(self, value):
|
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
|
@property
|
||||||
def push_url(self):
|
def push_url(self):
|
||||||
@@ -263,14 +264,16 @@ class Remote(object):
|
|||||||
|
|
||||||
Add a fetch refspec to the remote"""
|
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):
|
def add_push(self, spec):
|
||||||
"""add_push(refspec)
|
"""add_push(refspec)
|
||||||
|
|
||||||
Add a push refspec to the remote"""
|
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)")
|
@ffi.callback("int (*cb)(const char *ref, const char *msg, void *data)")
|
||||||
def _push_cb(ref, msg, data):
|
def _push_cb(ref, msg, data):
|
||||||
|
Reference in New Issue
Block a user