aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-08-22 11:54:35 -0300
committerEuAndreh <eu@euandre.org>2021-08-22 11:54:35 -0300
commit29baf33d3e170c71bdf5bb92d5e2afb388541db9 (patch)
treed4a62c2354b260e078da6740ebd432355e1f1dae /src
parentRename src/gistatic.* src/lib.* (diff)
downloadgistatic-29baf33d3e170c71bdf5bb92d5e2afb388541db9.tar.gz
gistatic-29baf33d3e170c71bdf5bb92d5e2afb388541db9.tar.xz
src/lib.c: Differentiate between -1 and other errors when looping through Git references
Diffstat (limited to '')
-rw-r--r--src/lib.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib.c b/src/lib.c
index 8f067b7..39a462b 100644
--- a/src/lib.c
+++ b/src/lib.c
@@ -1754,9 +1754,13 @@ static int repo_refs_write(
while (!(e = git_branch_next(&ref, &_btype, branch_iter))) {
e = repo_refs_branches_each(refs_fd, repo, ref);
git_reference_free(ref);
- if (e) {
+ if (e == -1) {
+ ret = -1;
goto cleanup;
}
+ if (e) {
+ ret = 1;
+ }
}
if (e != GIT_ITEROVER) {
const git_error *const error = git_error_last();
@@ -1799,9 +1803,13 @@ static int repo_refs_write(
while (!(e = git_reference_next(&ref, ref_iter))) {
e = repo_refs_tags_each(refs_fd, repo, ref, project_name);
git_reference_free(ref);
- if (e) {
+ if (e == -1) {
+ ret = -1;
goto cleanup;
}
+ if (e) {
+ ret = 1;
+ }
}
if (e != GIT_ITEROVER) {
const git_error *const error = git_error_last();