From ca4a0b6b80d1e52529f25076605de430af3abea9 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 3 Jan 2016 17:40:23 +0300 Subject: [PATCH] Index allows us to not turn -f on when changing ignore regexp --- libgrive/src/base/State.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/libgrive/src/base/State.cc b/libgrive/src/base/State.cc index f743033..20b13ef 100644 --- a/libgrive/src/base/State.cc +++ b/libgrive/src/base/State.cc @@ -42,13 +42,7 @@ State::State( const fs::path& filename, const Val& options ) : m_force = options.Has( "force" ) ? options["force"].Bool() : false ; 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() ) - m_force = true; m_ign = options["ignore"].Str(); - } else if ( options.Has( "dir" ) ) { const boost::regex trim_path( "^/+|/+$" ); @@ -58,8 +52,6 @@ State::State( const fs::path& filename, const Val& options ) : // "-s" is internally converted to an ignore regexp const boost::regex esc( "[.^$|()\\[\\]{}*+?\\\\]" ); std::string ign = "^(?!"+regex_replace( m_dir, esc, "\\\\&", boost::format_sed )+"(/|$))"; - if ( !m_ign.empty() && ign != m_ign ) - m_force = true; m_ign = ign; } }