diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-05-31 17:17:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-31 17:17:37 +0200 |
commit | 078c80f7500edd3adc3be5f7fb2801ba346c1d81 (patch) | |
tree | 823d5c7954ccc0d93b2be7f3257b369283102ff0 | |
parent | 04a699b8a9cebd83ece0011ec3a99e38a2adc3a8 (diff) | |
parent | 027fd45230b74c67e65d06e7073c04b62c60eb4e (diff) |
Merge pull request #6582 from NixOS/debug-fetchgit-sigsev
Fix a segfault in the git fetcher
-rw-r--r-- | src/libfetchers/git.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc index a71bff76f..9cbd39247 100644 --- a/src/libfetchers/git.cc +++ b/src/libfetchers/git.cc @@ -449,11 +449,10 @@ struct GitInputScheme : InputScheme } } - const Attrs unlockedAttrs({ + Attrs unlockedAttrs({ {"type", cacheType}, {"name", name}, {"url", actualUrl}, - {"ref", *input.getRef()}, }); Path repoDir; @@ -466,6 +465,7 @@ struct GitInputScheme : InputScheme head = "master"; } input.attrs.insert_or_assign("ref", *head); + unlockedAttrs.insert_or_assign("ref", *head); } if (!input.getRev()) @@ -482,6 +482,7 @@ struct GitInputScheme : InputScheme head = "master"; } input.attrs.insert_or_assign("ref", *head); + unlockedAttrs.insert_or_assign("ref", *head); } if (auto res = getCache()->lookup(store, unlockedAttrs)) { |