/**
  * Check if specified checkout rules are supported
  *
  * @param root root for which rules are checked
  * @param rules rules to check
  * @throws VcsException rules are not supported
  */
 private void validateCheckoutRules(
     @NotNull final VcsRoot root, @NotNull final CheckoutRules rules) throws VcsException {
   if (rules.getExcludeRules().size() != 0) {
     throw new VcsException(
         "Exclude rules are not supported for agent checkout for the git ("
             + rules.getExcludeRules().size()
             + " rule(s) detected) for VCS Root '"
             + root.getName()
             + "'");
   }
   if (rules.getIncludeRules().size() > 1) {
     throw new VcsException(
         "At most one include rule is supported for agent checkout for the git ("
             + rules.getIncludeRules().size()
             + " rule(s) detected) for VCS Root '"
             + root.getName()
             + "'");
   }
   if (rules.getIncludeRules().size() == 1) {
     IncludeRule ir = rules.getIncludeRules().get(0);
     if (!".".equals(ir.getFrom()) && ir.getFrom().length() != 0) {
       throw new VcsException(
           "Agent checkout for the git supports only include rule of form '. => subdir', rule '"
               + ir.toDescriptiveString()
               + "' for VCS Root '"
               + root.getName()
               + "' is not supported");
     }
   }
 }