git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 6, 2026, 17:39 UTC
Message-ID
<xmqqtsvtg49h.fsf@gitster.g>
In-Reply-To
<20260206093840.GC2761602@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> 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.

Show 5 quoted lines
>> 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.

Show 5 quoted lines
> 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.
Previous: Jeff KingNext: Jeff King
Message 13 of 14 in “t5550: add netrc tests for http 401/403”
  1. t5550: add netrc tests for http 401/403Ashlesh Gawande, Jan 6, 2026
  2. Junio C HamanoJan 6, 2026
  3. Ashlesh GawandeJan 6, 2026
  4. t5550: add netrc tests for http 401/403Ashlesh Gawande, Jan 6, 2026
  5. Junio C HamanoJan 7, 2026
  6. t5550: add netrc tests for http 401/403Ashlesh Gawande, Jan 7, 2026
  7. Ashlesh GawandeJan 31, 2026
  8. Junio C HamanoFeb 6, 2026
  9. Jeff KingFeb 6, 2026
  10. Ashlesh GawandeFeb 6, 2026
  11. Ashlesh GawandeFeb 6, 2026
  12. Jeff KingFeb 6, 2026
  13. Junio C HamanoFeb 6, 2026
  14. Jeff KingFeb 6, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.