loot_get_masterlist_revision() error code fix.

Don't use an error code when the masterlist simply isn't under version
control or doesn't exist, they are expected circumstances for the
function to be called under.
This commit is contained in:
Oliver Hamlet
2015-01-03 22:12:54 +00:00
parent 1a3c69eccf
commit cffaf55a9c
2 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -527,7 +527,10 @@ LOOT_API unsigned int loot_get_masterlist_revision(loot_db db,
db->extRevisionDate = ToNewCString(date);
}
catch (loot::error &e) {
return c_error(e);
if (e.code() == loot_ok)
return loot_ok;
else
return c_error(e);
}
catch (std::bad_alloc& e) {
return c_error(loot_error_no_mem, e.what());
+2 -2
View File
@@ -214,10 +214,10 @@ namespace loot {
void Masterlist::GetGitInfo(const boost::filesystem::path& path, bool shortID) {
if (!isRepository(path.parent_path())) {
throw error(error::git_error, "Unknown: Git repository missing");
throw error(error::ok, "Unknown: Git repository missing");
}
else if (!fs::exists(path)) {
throw error(error::git_error, "N/A: No masterlist present");
throw error(error::ok, "N/A: No masterlist present");
}
// Compare HEAD and working copy, and get revision info.