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
Jeff King <peff@peff.net>
Date
Feb 6, 2026, 20:44 UTC
Message-ID
<20260206204428.GA2787536@coredump.intra.peff.net>
In-Reply-To
<7583bd2c-4f2f-4a43-a36f-7e0698da8a57@ashlesh.me>
On Fri, Feb 06, 2026 at 09:23:18PM +0530, Ashlesh Gawande wrote:
Show 10 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.
> > In the case of fine-grained access token such that the token has read
> > access to the repository
> > but not write access GitHub does return a 403.
> > (I think this is correct behavior as the token has read access so user
> > is authorized/knows about the repository).
Ah, that makes sense.
> So should I modify that test case to do a push instead for this specific
> scenario (and update the description)?

No, I think what you have is fine. From the client's perspective, they know only that they got a 403 for some reason. So there's no need for complex modeling of what the server thinks is going on.

-Peff
Previous: Ashlesh GawandeNext: Junio C Hamano
Message 12 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.