From c6bde0aabaad90e7e3080f3afbed4a78fbfe0c75 Mon Sep 17 00:00:00 2001 From: Johannes Schlatow Date: Fri, 15 Oct 2010 00:21:10 +0200 Subject: [PATCH] Bug - fixed "Database is up to date" exception in merge command, which led to autopush being suppressed when changes were made on the local branch only --- src/TDB.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/TDB.cpp b/src/TDB.cpp index 39d7d0c30..fb35a70fd 100644 --- a/src/TDB.cpp +++ b/src/TDB.cpp @@ -1356,9 +1356,14 @@ void TDB::merge (const std::string& mergeFile) { // nothing happend on the remote branch // local branch is up-to-date - throw std::string ("Database is up to date."); + + // nothing happend on the local branch either + if (lit == l.end()) + throw std::string ("Database is up to date."); + else + std::cout << "No changes were made on the remote database.\n"; } - else // lit == undo.end () + else // lit == l.end () { // nothing happend on the local branch std::cout << "No changes were made on the local database. Adding remote changes...\n"; @@ -1543,10 +1548,6 @@ void TDB::merge (const std::string& mergeFile) if (! File::write (undoFile, undo, false)) throw std::string ("Could not write '") + undoFile + "'."; } - else // nothing to be done - { - std::cout << "No merge required.\n"; - } // delete objects lmods.clear ();