Re: [PATCH v3] t5550: add netrc tests for http 401/403
From: Jeff King <hidden>
Date: 2026-02-06 20:44:32
On Fri, Feb 06, 2026 at 09:23:18PM +0530, Ashlesh Gawande wrote:
quoted
quoted
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