@@ -33,7 +33,7 @@ static git_error tlsdata_error = {
3333
3434static void set_error_from_buffer (int error_class )
3535{
36- git_threadstate * threadstate = GIT_THREADSTATE ;
36+ git_threadstate * threadstate = git_threadstate_get () ;
3737 git_error * error ;
3838 git_str * buf ;
3939
@@ -51,7 +51,7 @@ static void set_error_from_buffer(int error_class)
5151
5252static void set_error (int error_class , char * string )
5353{
54- git_threadstate * threadstate = GIT_THREADSTATE ;
54+ git_threadstate * threadstate = git_threadstate_get () ;
5555 git_str * buf ;
5656
5757 if (!threadstate )
@@ -71,7 +71,7 @@ static void set_error(int error_class, char *string)
7171
7272void git_error_set_oom (void )
7373{
74- git_threadstate * threadstate = GIT_THREADSTATE ;
74+ git_threadstate * threadstate = git_threadstate_get () ;
7575
7676 if (!threadstate )
7777 return ;
@@ -94,7 +94,7 @@ void git_error_vset(int error_class, const char *fmt, va_list ap)
9494 DWORD win32_error_code = (error_class == GIT_ERROR_OS ) ? GetLastError () : 0 ;
9595#endif
9696
97- git_threadstate * threadstate = GIT_THREADSTATE ;
97+ git_threadstate * threadstate = git_threadstate_get () ;
9898 int error_code = (error_class == GIT_ERROR_OS ) ? errno : 0 ;
9999 git_str * buf ;
100100
@@ -135,7 +135,7 @@ void git_error_vset(int error_class, const char *fmt, va_list ap)
135135
136136int git_error_set_str (int error_class , const char * string )
137137{
138- git_threadstate * threadstate = GIT_THREADSTATE ;
138+ git_threadstate * threadstate = git_threadstate_get () ;
139139 git_str * buf ;
140140
141141 GIT_ASSERT_ARG (string );
@@ -157,7 +157,7 @@ int git_error_set_str(int error_class, const char *string)
157157
158158void git_error_clear (void )
159159{
160- git_threadstate * threadstate = GIT_THREADSTATE ;
160+ git_threadstate * threadstate = git_threadstate_get () ;
161161
162162 if (!threadstate )
163163 return ;
@@ -181,15 +181,15 @@ const git_error *git_error_last(void)
181181 if (!git_libgit2_init_count ())
182182 return & uninitialized_error ;
183183
184- if ((threadstate = GIT_THREADSTATE ) == NULL )
184+ if ((threadstate = git_threadstate_get () ) == NULL )
185185 return & tlsdata_error ;
186186
187187 return threadstate -> last_error ;
188188}
189189
190190int git_error_state_capture (git_error_state * state , int error_code )
191191{
192- git_threadstate * threadstate = GIT_THREADSTATE ;
192+ git_threadstate * threadstate = git_threadstate_get () ;
193193 git_error * error ;
194194 git_str * error_buf ;
195195
0 commit comments