Re: [RFC PATCH v3 2/2] t7406: add test for non-default branch in submodule
- From
Stefan Beller <sbeller@google.com>
- Date
- Apr 19, 2018, 17:52 UTC
- Message-ID
- <CAGZ79kaCW=iK3-Aq41Z5=WOz8hgrbo41XDCmnTVsAeqKwOuydA@mail.gmail.com>
- In-Reply-To
- <CAK0XTWecZASWULXYXGauV5WKhYinD7HXyXSTJntocQt3vzr4AA@mail.gmail.com>
Hi Eddy,
Show 7 quoted lines
> I suspect that in the tests, because the "server side" repos are > local, the git fetch-by-sha1/cloning by hash will be done correctly, > without the need of a branch hint, but the problem will still exist > for servers such as github which do not support fetch-by-sha1. > In case I realize that a server-side repo that doesn't support > fetch-by-sha1 is needed, is there a mechanism to set that up in the > test case, or do I have to rethink my approach?
You can force a clone (at least, not sure about fetch) to use the git protocol by --no-local, and then you can set uploadpack.{allowTipSHA1InWant, allowReachableSHA1InWant, allowAnySHA1InWant} as neded by the test.
From the fetch man page: For local repositories, also supported by Git natively, the following syntaxes may be used:
· /path/to/repo.git/
· file:///path/to/repo.git/
These two syntaxes are mostly equivalent, except when cloning, when the former implies --local option.
Thanks, Stefan