aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2020-12-24 14:16:09 -0600
committerGitHub <noreply@github.com>2020-12-24 14:16:09 -0600
commitede534a3a1aabc574a9fefe268a0a7a97a73138b (patch)
tree142c4393bc76c020c3f902618cf757762e963475 /src/libexpr/primops
parentd4870462f8f539adeaa6dca476aff6f1f31e1981 (diff)
parenta93916b1905cd7b968e92cd94a3e4a595bff2e0f (diff)
Merge branch 'master' into support-libcxx10
Diffstat (limited to 'src/libexpr/primops')
-rw-r--r--src/libexpr/primops/fetchMercurial.cc2
-rw-r--r--src/libexpr/primops/fetchTree.cc17
2 files changed, 12 insertions, 7 deletions
diff --git a/src/libexpr/primops/fetchMercurial.cc b/src/libexpr/primops/fetchMercurial.cc
index a77035c16..845a1ed1b 100644
--- a/src/libexpr/primops/fetchMercurial.cc
+++ b/src/libexpr/primops/fetchMercurial.cc
@@ -17,7 +17,7 @@ static void prim_fetchMercurial(EvalState & state, const Pos & pos, Value * * ar
state.forceValue(*args[0]);
- if (args[0]->type == tAttrs) {
+ if (args[0]->type() == nAttrs) {
state.forceAttrs(*args[0], pos);
diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc
index 1360ade39..e64e3fbb8 100644
--- a/src/libexpr/primops/fetchTree.cc
+++ b/src/libexpr/primops/fetchTree.cc
@@ -85,25 +85,25 @@ static void fetchTree(
state.forceValue(*args[0]);
- if (args[0]->type == tAttrs) {
+ if (args[0]->type() == nAttrs) {
state.forceAttrs(*args[0], pos);
fetchers::Attrs attrs;
for (auto & attr : *args[0]->attrs) {
state.forceValue(*attr.value);
- if (attr.value->type == tPath || attr.value->type == tString)
+ if (attr.value->type() == nPath || attr.value->type() == nString)
addURI(
state,
attrs,
attr.name,
state.coerceToString(*attr.pos, *attr.value, context, false, false)
);
- else if (attr.value->type == tString)
+ else if (attr.value->type() == nString)
addURI(state, attrs, attr.name, attr.value->string.s);
- else if (attr.value->type == tBool)
+ else if (attr.value->type() == nBool)
attrs.emplace(attr.name, Explicit<bool>{attr.value->boolean});
- else if (attr.value->type == tInt)
+ else if (attr.value->type == nInt)
attrs.emplace(attr.name, uint64_t(attr.value->integer));
else
throw TypeError("fetchTree argument '%s' is %s while a string, Boolean or integer is expected",
@@ -163,7 +163,7 @@ static void fetch(EvalState & state, const Pos & pos, Value * * args, Value & v,
state.forceValue(*args[0]);
- if (args[0]->type == tAttrs) {
+ if (args[0]->type() == nAttrs) {
state.forceAttrs(*args[0], pos);
@@ -324,6 +324,11 @@ static RegisterPrimOp primop_fetchGit({
A Boolean parameter that specifies whether submodules should be
checked out. Defaults to `false`.
+ - allRefs
+ Whether to fetch all refs of the repository. With this argument being
+ true, it's possible to load a `rev` from *any* `ref` (by default only
+ `rev`s from the specified `ref` are supported).
+
Here are some examples of how to use `fetchGit`.
- To fetch a private repository over SSH: