diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-04-19 11:16:14 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-04-19 11:16:14 +0200 |
commit | 46cb15df9b3501ca631779fa7d5c6299c1c17b53 (patch) | |
tree | 1c84d3c976cc70131efac35d6f8b5379dd3625cd /src/libexpr/primops/fetchGit.cc | |
parent | 6e4210d8ce76f52d9fd717660ea24b98ba780843 (diff) |
Fix assertion failure in FlakeRef::to_string()
Diffstat (limited to 'src/libexpr/primops/fetchGit.cc')
-rw-r--r-- | src/libexpr/primops/fetchGit.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libexpr/primops/fetchGit.cc b/src/libexpr/primops/fetchGit.cc index 391308224..40975d8d8 100644 --- a/src/libexpr/primops/fetchGit.cc +++ b/src/libexpr/primops/fetchGit.cc @@ -39,6 +39,7 @@ GitInfo exportGit(ref<Store> store, const std::string & uri, files. */ GitInfo gitInfo; + gitInfo.ref = "HEAD"; gitInfo.rev = "0000000000000000000000000000000000000000"; gitInfo.shortRev = std::string(gitInfo.rev, 0, 7); @@ -67,7 +68,6 @@ GitInfo exportGit(ref<Store> store, const std::string & uri, // clean working tree, but no ref or rev specified. Use 'HEAD'. rev = chomp(runProgram("git", true, { "-C", uri, "rev-parse", "HEAD" })); - ref = "HEAD"s; } if (!ref) ref = "HEAD"s; @@ -127,6 +127,7 @@ GitInfo exportGit(ref<Store> store, const std::string & uri, // FIXME: check whether rev is an ancestor of ref. GitInfo gitInfo; + gitInfo.ref = *ref; gitInfo.rev = rev != "" ? rev : chomp(readFile(localRefFile)); gitInfo.shortRev = std::string(gitInfo.rev, 0, 7); |