src/RocketFilterApp.cs
/// <summary>
/// Prepares the filtering by processing keep and remove entries.
/// </summary>
/// <exception cref="GitRocketFilter.RocketException">Expecting at least a commit or tree filtering option</exception>
Prepares the filtering by processing keep and remove entries.
Prepares the filtering by processing keep and remove entries .
private void PrepareFiltering()
        {
            keepPathPatterns = ParseTreeFilteringPathPatterns(KeepPatterns, "--keep");
            removePathPatterns = ParseTreeFilteringPathPatterns(RemovePatterns, "--remove");
            hasTreeFiltering = keepPathPatterns.Count > 0 ||
                               removePathPatterns.Count > 0;
            hasTreeFilteringWithScripts = keepPathPatterns.Any(pattern => !string.IsNullOrWhiteSpace(pattern.ScriptText));
            hasTreeFilteringWithScripts = hasTreeFilteringWithScripts ||
                                          removePathPatterns.Any(pattern => !string.IsNullOrWhiteSpace(pattern.ScriptText));
            hasCommitFiltering = !string.IsNullOrWhiteSpace(CommitFilter);
            if (!hasCommitFiltering && !hasTreeFiltering)
            {
                throw new RocketException("Expecting at least a commit or tree filtering option");
            }
        }
private void PrepareFiltering ( ) { keepPathPatterns = ParseTreeFilteringPathPatterns ( KeepPatterns , " " ) ; removePathPatterns = ParseTreeFilteringPathPatterns ( RemovePatterns , " " ) ; hasTreeFiltering = keepPathPatterns . Count > 0 || removePathPatterns . Count > 0 ; hasTreeFilteringWithScripts = keepPathPatterns . Any ( pattern => ! string . IsNullOrWhiteSpace ( pattern . ScriptText ) ) ; hasTreeFilteringWithScripts = hasTreeFilteringWithScripts || removePathPatterns . Any ( pattern => ! string . IsNullOrWhiteSpace ( pattern . ScriptText ) ) ; hasCommitFiltering = ! string . IsNullOrWhiteSpace ( CommitFilter ) ; if ( ! hasCommitFiltering && ! hasTreeFiltering ) { throw new RocketException ( " " ) ; } }
Prepares the filtering by processing keep and remove entries.
Prepares the filtering by processing keep and remove entries .
// Prepare tree filtering // If nothing to do, we are missing a parameter (either commit or tree filtering)
Expecting at least a commit or tree filtering option
Expecting at least a commit or tree filtering option