1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 00:11:17 +02:00

builtins.fetchgit: Support importing a working tree

For example, you can write

  src = fetchgit ./.;

and if ./. refers to an unclean working tree, that tree will be copied
to the Nix store. This removes the need for "cleanSource".
This commit is contained in:
Eelco Dolstra 2017-10-30 19:57:40 +01:00
parent 197922ea4e
commit 72cd52c3cd
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
7 changed files with 54 additions and 17 deletions

View file

@ -29,7 +29,7 @@ const std::string narVersionMagic1 = "nix-archive-1";
static string caseHackSuffix = "~nix~case~hack~";
PathFilter defaultPathFilter;
PathFilter defaultPathFilter = [](const Path &) { return true; };
static void dumpContents(const Path & path, size_t size,

View file

@ -44,13 +44,6 @@ namespace nix {
`+' denotes string concatenation. */
struct PathFilter
{
virtual ~PathFilter() { }
virtual bool operator () (const Path & path) { return true; }
};
extern PathFilter defaultPathFilter;
void dumpPath(const Path & path, Sink & sink,
PathFilter & filter = defaultPathFilter);

View file

@ -93,8 +93,6 @@ Hash hashFile(HashType ht, const Path & path);
/* Compute the hash of the given path. The hash is defined as
(essentially) hashString(ht, dumpPath(path)). */
struct PathFilter;
extern PathFilter defaultPathFilter;
typedef std::pair<Hash, unsigned long long> HashResult;
HashResult hashPath(HashType ht, const Path & path,
PathFilter & filter = defaultPathFilter);

View file

@ -481,4 +481,10 @@ struct MaintainCount
std::pair<unsigned short, unsigned short> getWindowSize();
/* Used in various places. */
typedef std::function<bool(const Path & path)> PathFilter;
extern PathFilter defaultPathFilter;
}