mirror of
https://github.com/NixOS/nix.git
synced 2025-01-31 17:12:30 +00:00
Merge pull request #12277 from DeterminateSystems/warn-relative-git
Warn against the use of relative 'git+file:' flake inputs
This commit is contained in:
commit
43a170a554
@ -435,7 +435,17 @@ struct GitInputScheme : InputScheme
|
||||
//
|
||||
// See: https://discourse.nixos.org/t/57783 and #9708
|
||||
//
|
||||
repoInfo.url = repoInfo.isLocal ? std::filesystem::absolute(url.path).string() : url.to_string();
|
||||
if (repoInfo.isLocal) {
|
||||
if (!isAbsolute(url.path)) {
|
||||
warn(
|
||||
"Fetching Git repository '%s', which uses a path relative to the current directory. "
|
||||
"This is not supported and will stop working in a future release. "
|
||||
"See https://github.com/NixOS/nix/issues/12281 for details.",
|
||||
url);
|
||||
}
|
||||
repoInfo.url = std::filesystem::absolute(url.path).string();
|
||||
} else
|
||||
repoInfo.url = url.to_string();
|
||||
|
||||
// If this is a local directory and no ref or revision is
|
||||
// given, then allow the use of an unclean working tree.
|
||||
|
Loading…
Reference in New Issue
Block a user