mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Check for masterlist before repo when getting revision.
It makes more sense to have "N/A" displayed instead of "Unknown" when there's no file present.
This commit is contained in:
+5
-5
@@ -221,14 +221,14 @@ namespace loot {
|
||||
git_handler git;
|
||||
git.ui_message = (boost::format(lc::translate("An error occurred while trying to read the local masterlist's version. If this error happens again, try deleting the \".git\" folder in %1%.")) % path.parent_path().string()).str();
|
||||
|
||||
if (!isRepository(path.parent_path())) {
|
||||
BOOST_LOG_TRIVIAL(info) << "Unknown masterlist revision: Git repository missing.";
|
||||
throw error(error::ok, lc::translate("Unknown: Git repository missing"));
|
||||
}
|
||||
else if (!fs::exists(path)) {
|
||||
if (!fs::exists(path)) {
|
||||
BOOST_LOG_TRIVIAL(info) << "Unknown masterlist revision: No masterlist present.";
|
||||
throw error(error::ok, lc::translate("N/A: No masterlist present"));
|
||||
}
|
||||
else if (!isRepository(path.parent_path())) {
|
||||
BOOST_LOG_TRIVIAL(info) << "Unknown masterlist revision: Git repository missing.";
|
||||
throw error(error::ok, lc::translate("Unknown: Git repository missing"));
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(debug) << "Existing repository found, attempting to open it.";
|
||||
git.call(git_repository_open(&git.repo, path.parent_path().string().c_str()));
|
||||
|
||||
Reference in New Issue
Block a user