diff options
Diffstat (limited to 'src/fetchhead.c')
-rw-r--r-- | src/fetchhead.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/fetchhead.c b/src/fetchhead.c index 67089d13d..4435454ef 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,8 +269,9 @@ int git_repository_fetchhead_foreach(git_repository *repo, else ref_name = NULL; - if ((cb(ref_name, remote_url, &oid, is_merge, payload)) != 0) { - error = GIT_EUSER; + error = cb(ref_name, remote_url, &oid, is_merge, payload); + if (error) { + giterr_set_after_callback(error); goto done; } } |