mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 15:56:18 +02:00
Improve git submodule error reporting
This commit is contained in:
parent
c257c82447
commit
6ec6b8aa36
3 changed files with 14 additions and 2 deletions
|
@ -220,6 +220,16 @@ std::pair<StorePath, Input> Input::fetch(ref<Store> store) const
|
||||||
return {std::move(storePath), input};
|
return {std::move(storePath), input};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::pair<ref<InputAccessor>, Input> Input::getAccessor(ref<Store> store) const
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
return scheme->getAccessor(store, *this);
|
||||||
|
} catch (Error & e) {
|
||||||
|
e.addTrace({}, "while fetching the input '%s'", to_string());
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Input Input::applyOverrides(
|
Input Input::applyOverrides(
|
||||||
std::optional<std::string> ref,
|
std::optional<std::string> ref,
|
||||||
std::optional<Hash> rev) const
|
std::optional<Hash> rev) const
|
||||||
|
|
|
@ -83,6 +83,8 @@ public:
|
||||||
*/
|
*/
|
||||||
std::pair<StorePath, Input> fetch(ref<Store> store) const;
|
std::pair<StorePath, Input> fetch(ref<Store> store) const;
|
||||||
|
|
||||||
|
std::pair<ref<InputAccessor>, Input> getAccessor(ref<Store> store) const;
|
||||||
|
|
||||||
Input applyOverrides(
|
Input applyOverrides(
|
||||||
std::optional<std::string> ref,
|
std::optional<std::string> ref,
|
||||||
std::optional<Hash> rev) const;
|
std::optional<Hash> rev) const;
|
||||||
|
|
|
@ -605,7 +605,7 @@ struct GitInputScheme : InputScheme
|
||||||
attrs.insert_or_assign("rev", submoduleRev.gitRev());
|
attrs.insert_or_assign("rev", submoduleRev.gitRev());
|
||||||
auto submoduleInput = fetchers::Input::fromAttrs(std::move(attrs));
|
auto submoduleInput = fetchers::Input::fromAttrs(std::move(attrs));
|
||||||
auto [submoduleAccessor, submoduleInput2] =
|
auto [submoduleAccessor, submoduleInput2] =
|
||||||
submoduleInput.scheme->getAccessor(store, submoduleInput);
|
submoduleInput.getAccessor(store);
|
||||||
mounts.insert_or_assign(submodule.path, submoduleAccessor);
|
mounts.insert_or_assign(submodule.path, submoduleAccessor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -649,7 +649,7 @@ struct GitInputScheme : InputScheme
|
||||||
attrs.insert_or_assign("url", submodulePath.abs());
|
attrs.insert_or_assign("url", submodulePath.abs());
|
||||||
auto submoduleInput = fetchers::Input::fromAttrs(std::move(attrs));
|
auto submoduleInput = fetchers::Input::fromAttrs(std::move(attrs));
|
||||||
auto [submoduleAccessor, submoduleInput2] =
|
auto [submoduleAccessor, submoduleInput2] =
|
||||||
submoduleInput.scheme->getAccessor(store, submoduleInput);
|
submoduleInput.getAccessor(store);
|
||||||
|
|
||||||
/* If the submodule is dirty, mark this repo dirty as
|
/* If the submodule is dirty, mark this repo dirty as
|
||||||
well. */
|
well. */
|
||||||
|
|
Loading…
Reference in a new issue