forked from lix-project/lix
fetchgit -> fetchGit
Almost all other primops are camelCase so no reason not to use that here.
This commit is contained in:
parent
23ce4b3393
commit
049322702b
|
@ -184,7 +184,7 @@
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><function>builtins.fetchgit</function>.
|
<para><function>builtins.fetchGit</function>.
|
||||||
(38539b943a060d9cdfc24d6e5d997c0885b8aa2f)</para>
|
(38539b943a060d9cdfc24d6e5d997c0885b8aa2f)</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
|
|
@ -88,10 +88,10 @@ Path exportGit(ref<Store> store, const std::string & uri,
|
||||||
return storePath;
|
return storePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void prim_fetchgit(EvalState & state, const Pos & pos, Value * * args, Value & v)
|
static void prim_fetchGit(EvalState & state, const Pos & pos, Value * * args, Value & v)
|
||||||
{
|
{
|
||||||
// FIXME: cut&paste from fetch().
|
// FIXME: cut&paste from fetch().
|
||||||
if (state.restricted) throw Error("'fetchgit' is not allowed in restricted mode");
|
if (state.restricted) throw Error("'fetchGit' is not allowed in restricted mode");
|
||||||
|
|
||||||
std::string url;
|
std::string url;
|
||||||
std::string ref = "master";
|
std::string ref = "master";
|
||||||
|
@ -118,7 +118,7 @@ static void prim_fetchgit(EvalState & state, const Pos & pos, Value * * args, Va
|
||||||
else if (n == "name")
|
else if (n == "name")
|
||||||
name = state.forceStringNoCtx(*attr.value, *attr.pos);
|
name = state.forceStringNoCtx(*attr.value, *attr.pos);
|
||||||
else
|
else
|
||||||
throw EvalError("unsupported argument '%s' to 'fetchgit', at %s", attr.name, *attr.pos);
|
throw EvalError("unsupported argument '%s' to 'fetchGit', at %s", attr.name, *attr.pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (url.empty())
|
if (url.empty())
|
||||||
|
@ -132,6 +132,6 @@ static void prim_fetchgit(EvalState & state, const Pos & pos, Value * * args, Va
|
||||||
mkString(v, storePath, PathSet({storePath}));
|
mkString(v, storePath, PathSet({storePath}));
|
||||||
}
|
}
|
||||||
|
|
||||||
static RegisterPrimOp r("__fetchgit", 1, prim_fetchgit);
|
static RegisterPrimOp r("fetchGit", 1, prim_fetchGit);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue