summaryrefslogtreecommitdiff
path: root/src/fetchhead.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-12-06 15:42:20 -0800
committerRussell Belfer <rb@github.com>2013-12-11 10:57:50 -0800
commitc7b3e1b32040d05f3cb996d754a28af3b4d06d0b (patch)
treec2cb268aeb8b8dc244970034d1d220867c6ed62b /src/fetchhead.c
parent60058018dcadbaa1f70281c9d29faf1e46d3a87c (diff)
downloadlibgit2-c7b3e1b32040d05f3cb996d754a28af3b4d06d0b.tar.gz
Some callback error check style cleanups
I find this easier to read...
Diffstat (limited to 'src/fetchhead.c')
-rw-r--r--src/fetchhead.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/fetchhead.c b/src/fetchhead.c
index 7c37be4c6..2f217fad1 100644
--- a/src/fetchhead.c
+++ b/src/fetchhead.c
@@ -260,8 +260,8 @@ int git_repository_fetchhead_foreach(git_repository *repo,
while ((line = git__strsep(&buffer, "\n")) != NULL) {
++line_num;
- if ((error = fetchhead_ref_parse(&oid, &is_merge, &name, &remote_url,
- line, line_num)) < 0)
+ if ((error = fetchhead_ref_parse(
+ &oid, &is_merge, &name, &remote_url, line, line_num)) < 0)
goto done;
if (git_buf_len(&name) > 0)
@@ -269,10 +269,11 @@ int git_repository_fetchhead_foreach(git_repository *repo,
else
ref_name = NULL;
- error = GITERR_CALLBACK(
- cb(ref_name, remote_url, &oid, is_merge, payload) );
- if (error)
+ error = cb(ref_name, remote_url, &oid, is_merge, payload);
+ if (error) {
+ GITERR_CALLBACK(error);
goto done;
+ }
}
if (*buffer) {