@@ -162,7 +162,7 @@ static int handle_auth(
162162
163163 if (error > 0 ) {
164164 git_error_set (GIT_ERROR_HTTP , "%s authentication required but no callback set" , server_type );
165- error = -1 ;
165+ error = GIT_EAUTH ;
166166 }
167167
168168 if (!error )
@@ -179,7 +179,7 @@ GIT_INLINE(int) handle_remote_auth(
179179
180180 if (response -> server_auth_credtypes == 0 ) {
181181 git_error_set (GIT_ERROR_HTTP , "server requires authentication that we do not support" );
182- return -1 ;
182+ return GIT_EAUTH ;
183183 }
184184
185185 /* Otherwise, prompt for credentials. */
@@ -201,7 +201,7 @@ GIT_INLINE(int) handle_proxy_auth(
201201
202202 if (response -> proxy_auth_credtypes == 0 ) {
203203 git_error_set (GIT_ERROR_HTTP , "proxy requires authentication that we do not support" );
204- return -1 ;
204+ return GIT_EAUTH ;
205205 }
206206
207207 /* Otherwise, prompt for credentials. */
@@ -259,7 +259,7 @@ static int handle_response(
259259 } else if (response -> status == GIT_HTTP_STATUS_UNAUTHORIZED ||
260260 response -> status == GIT_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED ) {
261261 git_error_set (GIT_ERROR_HTTP , "unexpected authentication failure" );
262- return -1 ;
262+ return GIT_EAUTH ;
263263 }
264264
265265 if (response -> status != GIT_HTTP_STATUS_OK ) {
@@ -416,7 +416,7 @@ static int http_stream_read(
416416
417417 if (stream -> state == HTTP_STATE_SENDING_REQUEST ) {
418418 git_error_set (GIT_ERROR_HTTP , "too many redirects or authentication replays" );
419- error = -1 ;
419+ error = GIT_ERROR ; /* not GIT_EAUTH, because the exact cause is unclear */
420420 goto done ;
421421 }
422422
@@ -554,7 +554,7 @@ static int http_stream_write(
554554 if (stream -> state == HTTP_STATE_NONE ) {
555555 git_error_set (GIT_ERROR_HTTP ,
556556 "too many redirects or authentication replays" );
557- error = -1 ;
557+ error = GIT_ERROR ; /* not GIT_EAUTH because the exact cause is unclear */
558558 goto done ;
559559 }
560560
0 commit comments