Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Returning a non-zero value from a callback results in an error #123

Merged
merged 1 commit into from

2 participants

@jacquesg
Owner

We should be passing GIT_EUSER to libgit2 and check for GIT_EUSER when the function returns.

@jacquesg Stash.xs: Ignore GIT_EUSER, its not an error
* Tag and Config may have been affected similarly. If the user
returns a non-zero value in the callback, pass GIT_EUSER to
libgit2 regardless of the actual value returned by the user.
2a13e98
@coveralls

Coverage Status

Coverage decreased (-0.09%) when pulling 2a13e98 on jacquesg/user-callback into e5bb418 on master.

@jacquesg jacquesg merged commit 2a13e98 into master

1 check passed

Details continuous-integration/travis-ci The Travis CI build passed
@jacquesg jacquesg deleted the jacquesg/user-callback branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 17, 2014
  1. Stash.xs: Ignore GIT_EUSER, its not an error

    authored
    * Tag and Config may have been affected similarly. If the user
    returns a non-zero value in the callback, pass GIT_EUSER to
    libgit2 regardless of the actual value returned by the user.
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 2 deletions.
  1. +9 −0 Raw.xs
  2. +2 −2 xs/Stash.xs
View
9 Raw.xs
@@ -983,6 +983,9 @@ STATIC int git_config_foreach_cbb(const git_config_entry *entry, void *payload)
FREETMPS;
LEAVE;
+ if (rv != 0)
+ rv = GIT_EUSER;
+
return rv;
}
@@ -1008,6 +1011,9 @@ STATIC int git_stash_foreach_cb(size_t i, const char *msg, const git_oid *oid, v
FREETMPS;
LEAVE;
+ if (rv != 0)
+ rv = GIT_EUSER;
+
return rv;
}
@@ -1048,6 +1054,9 @@ STATIC int git_tag_foreach_cbb(const char *name, git_oid *oid, void *payload) {
FREETMPS;
LEAVE;
+ if (rv != 0)
+ rv = GIT_EUSER;
+
return rv;
}
View
4 xs/Stash.xs
@@ -70,8 +70,8 @@ foreach(class, repo, cb)
rc = git_stash_foreach(
payload.repo_ptr -> repository, git_stash_foreach_cb, &payload
);
-
- git_check_error(rc);
+ if (rc != GIT_EUSER)
+ git_check_error(rc);
void
drop(class, repo, index)
Something went wrong with that request. Please try again.