builtins.fetchGit: Return an attrset with revision info
This adds rev, shortRev and revCount attributes, equal to what Hydra provides. E.g. $ nix eval '(fetchGit https://github.com/NixOS/patchelf.git)' { outPath = "/nix/store/ghigrkw02l440g8vfxa9wj4c3zpfmw99-source"; rev = "29c085fd9d3fc972f75b3961905d6b4ecce7eb2b"; revCount = 303; shortRev = "29c085f"; }
This commit is contained in:
parent
f9686885be
commit
e38382895d
3 changed files with 54 additions and 18 deletions
|
@ -2,13 +2,21 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "ref.hh"
|
||||
#include "util.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
class Store;
|
||||
|
||||
Path exportGit(ref<Store> store, const std::string & uri,
|
||||
struct GitInfo
|
||||
{
|
||||
Path storePath;
|
||||
std::string rev;
|
||||
std::string shortRev;
|
||||
uint64_t revCount = 0;
|
||||
};
|
||||
|
||||
GitInfo exportGit(ref<Store> store, const std::string & uri,
|
||||
const std::string & ref, const std::string & rev = "",
|
||||
const std::string & name = "");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue