Skip to content

Commit 50dcbe0

Browse files
committed
Use correct class for credentials_cb error
The first parameter of `git_error_set_str` is supposed to be an error class, not the raw error code. The main consequence is that the error message should show the class code instead of the error code (which would usually just be GIT_ERROR).
1 parent 727d73f commit 50dcbe0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/remote_callbacks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ extern "C" fn credentials_cb(
290290

291291
callback(url, username_from_url, cred_type).map_err(|e| {
292292
let s = CString::new(e.to_string()).unwrap();
293-
raw::git_error_set_str(e.raw_code() as c_int, s.as_ptr());
293+
raw::git_error_set_str(e.class() as c_int, s.as_ptr());
294294
e.raw_code() as c_int
295295
})
296296
});

0 commit comments

Comments
 (0)