Skip to content

Commit

Permalink
Deal with a second place where path could be overridden. Fixes: #274.…
Browse files Browse the repository at this point in the history
… refs: #274
  • Loading branch information
spanezz committed Oct 20, 2021
1 parent ad6967c commit 9547484
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arki/dataset/local.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ std::shared_ptr<core::cfg::Sections> Reader::read_configs(const std::string& pat
auto sec = core::cfg::Section::parse(in);
// Fill in missing bits
sec->set("name", name);
sec->set("path", sys::abspath(path));
if (sec->value("type") != "remote")
sec->set("path", sys::abspath(path));

// Return a Sections with only this section
auto res = std::make_shared<core::cfg::Sections>();
Expand Down
5 changes: 5 additions & 0 deletions arki/dataset/session-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ step = daily
auto cfg = dataset::Session::read_config("testds");
wassert(actual(cfg->value("name")) == "testds");
wassert(actual(cfg->value("path")) == "http://example.org");

auto configs = dataset::Session::read_configs("testds");
cfg = configs->section("testds");
wassert(actual(cfg->value("name")) == "testds");
wassert(actual(cfg->value("path")) == "http://example.org");
});

}
Expand Down

0 comments on commit 9547484

Please sign in to comment.