mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
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:
+4
-1
@@ -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
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user