diff options
| author | Tyler Wanek <tylerw@axosoft.com> | 2019-02-21 09:27:16 -0700 |
|---|---|---|
| committer | Tyler Wanek <tylerw@axosoft.com> | 2019-02-21 09:27:16 -0700 |
| commit | 3d8c54be6b5f4e5643567cfba0d1eaee0e83b050 (patch) | |
| tree | e845d5842506e134c772b43e1d5c4e654d095f53 /src/rebase.c | |
| parent | 372694fe20ae9cca953aa5c5ce2f2e2cfa5d16e7 (diff) | |
| download | libgit2-3d8c54be6b5f4e5643567cfba0d1eaee0e83b050.tar.gz | |
Clear error before calling signing_cb, set error if one has not been set
We should clear the error before calling the signing_cb to allow the signing_cb to set its own errors. If the CB did not provide an error, we should set our own generic error before exiting rebase_commit__create
Diffstat (limited to 'src/rebase.c')
| -rw-r--r-- | src/rebase.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rebase.c b/src/rebase.c index e313db970..6aef85913 100644 --- a/src/rebase.c +++ b/src/rebase.c @@ -986,10 +986,12 @@ static int rebase_commit__create( message_encoding, message, tree, 1, (const git_commit **)&parent_commit)) < 0) goto done; + git_error_clear(); if ((error = rebase->options.signing_cb(&commit_signature, &signature_field, git_buf_cstr(&commit_content), rebase->options.payload)) < 0 && error != GIT_PASSTHROUGH) { - git_error_set(error, "signing_cb failed"); + if (git_error_last() == NULL) + git_error_set(GIT_ERROR_CALLBACK, "commit signing_cb failed"); goto done; } |
