From 5fb3c187fef4b257083a6e954d037f157fa9730c Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 28 Dec 2015 02:00:47 +0300 Subject: [PATCH] Oops this was a fail. ignore option was ignored if it was previously empty in grive_state. Fixes #50 --- libgrive/src/base/State.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libgrive/src/base/State.cc b/libgrive/src/base/State.cc index 1f79e3d..fb64a47 100644 --- a/libgrive/src/base/State.cc +++ b/libgrive/src/base/State.cc @@ -41,12 +41,13 @@ State::State( const fs::path& filename, const Val& options ) : bool force = options.Has( "force" ) ? options["force"].Bool() : false ; - if ( options.Has( "ignore" ) && !m_ign.empty() && options["ignore"].Str() != m_ign ) + if ( options.Has( "ignore" ) && options["ignore"].Str() != m_ign ) { // also "-f" is implicitly turned on when ignore regexp is changed // because without it grive would think that previously ignored files are deleted locally + if ( !m_ign.empty() ) + force = true; m_ign = options["ignore"].Str(); - force = true; } else if ( options.Has( "dir" ) ) {