File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -164,8 +164,7 @@ struct GitInputScheme : InputScheme
164164{
165165 std::optional<Input> inputFromURL (const Settings & settings, const ParsedURL & url, bool requireTree) const override
166166 {
167- auto parsedScheme = parseUrlScheme (url.scheme );
168- if (parsedScheme.application != " git" )
167+ if (url.scheme != " git" && parseUrlScheme (url.scheme ).application != " git" )
169168 return {};
170169
171170 auto url2 (url);
Original file line number Diff line number Diff line change @@ -206,6 +206,28 @@ INSTANTIATE_TEST_SUITE_P(
206206 .description = " flake_id_ref_branch_ignore_empty_segments_ref_rev" ,
207207 .expectedUrl = " flake:nixpkgs/branch/2aae6c35c94fcfb415dbe95f408b9ce91ee846ed" ,
208208 },
209+ InputFromURLTestCase{
210+ .url = " git://somewhere/repo?ref=branch" ,
211+ .attrs =
212+ {
213+ {" type" , Attr (" git" )},
214+ {" ref" , Attr (" branch" )},
215+ {" url" , Attr (" git://somewhere/repo" )},
216+ },
217+ .description = " plain_git_with_ref" ,
218+ .expectedUrl = " git://somewhere/repo?ref=branch" ,
219+ },
220+ InputFromURLTestCase{
221+ .url = " git+https://somewhere.aaaaaaa/repo?ref=branch" ,
222+ .attrs =
223+ {
224+ {" type" , Attr (" git" )},
225+ {" ref" , Attr (" branch" )},
226+ {" url" , Attr (" https://somewhere.aaaaaaa/repo" )},
227+ },
228+ .description = " git_https_with_ref" ,
229+ .expectedUrl = " git+https://somewhere.aaaaaaa/repo?ref=branch" ,
230+ },
209231 InputFromURLTestCase{
210232 // Note that this is different from above because the "flake id" shorthand
211233 // doesn't allow this.
You can’t perform that action at this time.
0 commit comments