mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
Git fetcher: Don't pass URL query parameters for file:// URLs
Git interprets them as part of the file name, so passing parameters like 'rev' breaks. Only relevant for testing (when _NIX_FORCE_HTTP is set) and local bare repos.
This commit is contained in:
parent
cfe93299b1
commit
9f72d5bce9
1 changed files with 7 additions and 1 deletions
|
@ -459,8 +459,14 @@ struct GitInputScheme : InputScheme
|
|||
url);
|
||||
}
|
||||
repoInfo.location = std::filesystem::absolute(url.path);
|
||||
} else
|
||||
} else {
|
||||
if (url.scheme == "file")
|
||||
/* Query parameters are meaningless for file://, but
|
||||
Git interprets them as part of the file name. So get
|
||||
rid of them. */
|
||||
url.query.clear();
|
||||
repoInfo.location = url;
|
||||
}
|
||||
|
||||
// If this is a local directory and no ref or revision is
|
||||
// given, then allow the use of an unclean working tree.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue