From b818bf324c0c6c379ba2e695834eedb784a68929 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 9 May 2012 19:27:34 +0300 Subject: [PATCH] Disallow empty rebuild reason --- source/analyzer.cpp | 7 +------ source/target.cpp | 3 +++ 2 files changed, 4 insertions(+), 6 deletions(-) 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; } -- 2.45.2