1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-21 11:30:30 -04:00
nix/src/libexpr/primops/fetchGit.hh
Eelco Dolstra 0f840483c7
Add date of last commit to SourceInfo
This is primarily useful for version string generation, where we need
a monotonically increasing number. The revcount is the preferred thing
to use, but isn't available for GitHub flakes (since it requires
fetching the entire history). The last commit timestamp OTOH can be
extracted from GitHub tarballs.
2019-05-29 10:10:36 +02:00

24 lines
358 B
C++

#pragma once
#include "store-api.hh"
#include <regex>
namespace nix {
struct GitInfo
{
Path storePath;
std::string ref;
Hash rev{htSHA1};
uint64_t revCount;
time_t lastModified;
};
GitInfo exportGit(ref<Store> store, std::string uri,
std::optional<std::string> ref,
std::optional<Hash> rev,
const std::string & name);
}