1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 13:41:15 +02:00

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:
Eelco Dolstra 2017-10-30 11:49:03 +01:00
parent f9686885be
commit e38382895d
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 54 additions and 18 deletions

View file

@ -667,7 +667,7 @@ std::pair<bool, std::string> EvalState::resolveSearchPathElem(const SearchPathEl
try {
if (hasPrefix(elem.second, "git://") || hasSuffix(elem.second, ".git"))
// FIXME: support specifying revision/branch
res = { true, exportGit(store, elem.second, "master") };
res = { true, exportGit(store, elem.second, "master").storePath };
else
res = { true, getDownloader()->downloadCached(store, elem.second, true) };
} catch (DownloadError & e) {