forked from lix-project/lix
Improve git submodule error reporting
This commit is contained in:
parent
c257c82447
commit
6ec6b8aa36
|
@ -220,6 +220,16 @@ std::pair<StorePath, Input> Input::fetch(ref<Store> store) const
|
|||
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(
|
||||
std::optional<std::string> ref,
|
||||
std::optional<Hash> rev) const
|
||||
|
|
|
@ -83,6 +83,8 @@ public:
|
|||
*/
|
||||
std::pair<StorePath, Input> fetch(ref<Store> store) const;
|
||||
|
||||
std::pair<ref<InputAccessor>, Input> getAccessor(ref<Store> store) const;
|
||||
|
||||
Input applyOverrides(
|
||||
std::optional<std::string> ref,
|
||||
std::optional<Hash> rev) const;
|
||||
|
|
|
@ -605,7 +605,7 @@ struct GitInputScheme : InputScheme
|
|||
attrs.insert_or_assign("rev", submoduleRev.gitRev());
|
||||
auto submoduleInput = fetchers::Input::fromAttrs(std::move(attrs));
|
||||
auto [submoduleAccessor, submoduleInput2] =
|
||||
submoduleInput.scheme->getAccessor(store, submoduleInput);
|
||||
submoduleInput.getAccessor(store);
|
||||
mounts.insert_or_assign(submodule.path, submoduleAccessor);
|
||||
}
|
||||
|
||||
|
@ -649,7 +649,7 @@ struct GitInputScheme : InputScheme
|
|||
attrs.insert_or_assign("url", submodulePath.abs());
|
||||
auto submoduleInput = fetchers::Input::fromAttrs(std::move(attrs));
|
||||
auto [submoduleAccessor, submoduleInput2] =
|
||||
submoduleInput.scheme->getAccessor(store, submoduleInput);
|
||||
submoduleInput.getAccessor(store);
|
||||
|
||||
/* If the submodule is dirty, mark this repo dirty as
|
||||
well. */
|
||||
|
|
Loading…
Reference in a new issue