From: Mikko Rasa Date: Wed, 9 May 2012 16:27:34 +0000 (+0300) Subject: Disallow empty rebuild reason X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=b818bf324c0c6c379ba2e695834eedb784a68929;p=builder.git Disallow empty rebuild reason --- diff --git a/source/analyzer.cpp b/source/analyzer.cpp index 1538678..58c2b90 100644 --- a/source/analyzer.cpp +++ b/source/analyzer.cpp @@ -95,12 +95,7 @@ void Analyzer::build_depend_table(Target &tgt, unsigned depth) row.push_back(""); if(tgt.needs_rebuild()) - { - if(tgt.get_rebuild_reason().empty()) - row.push_back("Yes (no reason)"); - else - row.push_back(tgt.get_rebuild_reason()); - } + row.push_back(tgt.get_rebuild_reason()); table.push_back(row); diff --git a/source/target.cpp b/source/target.cpp index 44a758f..297ae3f 100644 --- a/source/target.cpp +++ b/source/target.cpp @@ -97,6 +97,9 @@ Task *Target::build() void Target::mark_rebuild(const std::string &reason) { + if(reason.empty()) + throw invalid_argument("No reason given for rebuilding "+name); + state = REBUILD; rebuild_reason = reason; }