Thread (2 messages) flat view 2 messages, 2 authors, 2026-02-06

Re: [PATCH v3] t5550: add netrc tests for http 401/403

From: Junio C Hamano <hidden>
Date: 2026-02-06 17:39:56

Jeff King [off-list ref] writes:
I think it is fine to check the 403 handling, but note that this _isn't_
how GitHub would respond. If you try to fetch from a repository you
don't have access to, it will return a 401 first (so you try to log in)
and then a 404. The idea being to avoid revealing the existence of the
repository to unauthorized users.
That is a sensible thing to do on the server side.  Presumably when
we talk with such a server we would report 404, right?  It is not
like we behave all that differently with either type of errors---as
long as we just give up and do not fall into an infinite loop of
asking "oops, that password did not work, try again", it would be
OK.
quoted
Just out of curiosity, do we test for these codes with other
credential helpers or is this only relevant for .netrc users?
The netrc support here should not involve credential helpers at all. It
is all being done internally by curl.
Yeah, I phrased my question in a wrong way.  As the code paths
involving credential helpers are separate, I wondered if we have
similar test coverage there as well.
So really, none of this is testing anything novel in Git at all that is
not covered elsewhere, except for the fact that we pass the flag to curl
that says "you may use netrc". And so there's some value in adding it in
that case. But trying to answer your question about other credential
helpers, no, they're not even entering the picture here.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help