File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ The public error API
128128 bugs, but in the meantime, please code defensively and check for NULL
129129 when calling this function.
130130
131- - `void geterr_clear (void)`: This function clears the last error. The
131+ - `void giterr_clear (void)`: This function clears the last error. The
132132 library will call this when an error is generated by low level function
133133 and the higher level function handles the error.
134134
Original file line number Diff line number Diff line change @@ -157,12 +157,16 @@ void test_refs_reflog_reflog__reading_the_reflog_from_a_reference_with_no_log_re
157157void test_refs_reflog_reflog__reading_a_reflog_with_invalid_format_returns_error (void )
158158{
159159 git_reflog * reflog ;
160- git_error * error ;
160+ const git_error * error ;
161+
162+ /* clear the error state so we can capture the error generated by git_reflog_read */
163+ giterr_clear ();
161164
162165 cl_git_fail (git_reflog_read (& reflog , g_repo , "refs/heads/extra-newline" ));
163166
164167 error = giterr_last ();
165- cl_assert (error );
168+
169+ cl_assert (error != NULL );
166170 cl_assert_equal_s ("Unable to parse OID - contains invalid characters" , error -> message );
167171}
168172
You can’t perform that action at this time.
0 commit comments