Commits

Sebastian Sdorra committed 5e286ff

added option to disable sub repository detection of browse command

  • Participants
  • Parent commits 2c5a4f4

Comments (0)

Files changed (2)

File scm-core/src/main/java/sonia/scm/repository/api/BrowseCommandBuilder.java

   }
 
   /**
+   * Enable or disable the detection of sub repositories.
+   *
+   *
+   * @param disableSubRepositoryDetection true to disable sub repository detection.
+   *
+   * @return {@code this}
+   *
+   * @since 1.26
+   */
+  public BrowseCommandBuilder setDisableSubRepositoryDetection(
+    boolean disableSubRepositoryDetection)
+  {
+    this.request.setDisableSubRepositoryDetection(
+      disableSubRepositoryDetection);
+
+    return this;
+  }
+
+  /**
    * Retrieve only files which are children of the given path.
    * This path have to be a directory.
    *

File scm-core/src/main/java/sonia/scm/repository/spi/BrowseCommandRequest.java

     final BrowseCommandRequest other = (BrowseCommandRequest) obj;
 
     return super.equals(obj) && Objects.equal(recursive, other.recursive)
-      && Objects.equal(disableLastCommit, other.disableLastCommit);
+      && Objects.equal(disableLastCommit, other.disableLastCommit)
+      && Objects.equal(disableSubRepositoryDetection,
+        other.disableSubRepositoryDetection);
   }
 
   /**
   @Override
   public int hashCode()
   {
-    return Objects.hashCode(super.hashCode(), recursive, disableLastCommit);
+    return Objects.hashCode(super.hashCode(), recursive, disableLastCommit,
+      disableSubRepositoryDetection);
   }
 
   /**
                   .add("revision", getRevision())
                   .add("recursive", recursive)
                   .add("disableLastCommit", disableLastCommit)
+                  .add("disableSubRepositoryDetection", disableSubRepositoryDetection)
                   .toString();
     //J+
   }
   }
 
   /**
+   * Enable or Disable sub repository detection. Default is enabled.
+   *
+   *
+   * @param disableSubRepositoryDetection true to disable sub repository detection
+   *
+   * @since 1.26
+   */
+  public void setDisableSubRepositoryDetection(
+    boolean disableSubRepositoryDetection)
+  {
+    this.disableSubRepositoryDetection = disableSubRepositoryDetection;
+  }
+
+  /**
    * True to enable recursive file object browsing.
    *
    *
   }
 
   /**
+   * Returns true if the detection of sub repositories is disabled.
+   *
+   *
+   * @return true if sub repository detection is disabled.
+   *
+   * @since 1.26
+   */
+  boolean isDisableSubRepositoryDetection()
+  {
+    return disableSubRepositoryDetection;
+  }
+
+  /**
    * Returns true if recursive file object browsing is enabled.
    *
    *
   /** disable last commit */
   private boolean disableLastCommit = false;
 
+  /** disable detection of sub repositories */
+  private boolean disableSubRepositoryDetection = false;
+
   /** browse file objects recursive */
   private boolean recursive = false;
 }