builtins.fetchgit: Support a "name" attribute

The "name" attribute defaults to "source", which we should use for all
similar functions (e.g. fetchTarball and in Hydra) to ensure that we
get a consistent store path regardless of how the tree is fetched.

"source" is not necessarily a correct label, but using an empty name
is problematic: you get an ugly store path ending in a dash, and it's
impossible to have a fixed-output derivation that produces that path
because ".drv" is not a valid store name.

Fixes #904.
This commit is contained in:
Eelco Dolstra 2017-10-30 09:57:38 +01:00
parent c1ae18941a
commit 65b5f177b5
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
2 changed files with 18 additions and 11 deletions

View file

@ -9,6 +9,7 @@ namespace nix {
class Store;
Path exportGit(ref<Store> store, const std::string & uri,
const std::string & ref, const std::string & rev = "");
const std::string & ref, const std::string & rev = "",
const std::string & name = "");
}