James Moger
2011-07-22 b1dba764c201f4708b82767b2d91edb6e189ce6f
src/com/gitblit/utils/JGitUtils.java
@@ -80,6 +80,12 @@
import com.gitblit.models.PathModel.PathChangeModel;
import com.gitblit.models.RefModel;
/**
 * Collection of static methods for retrieving information from a repository.
 *
 * @author James Moger
 *
 */
public class JGitUtils {
   static final Logger LOGGER = LoggerFactory.getLogger(JGitUtils.class);
@@ -298,14 +304,14 @@
   /**
    * Determine if a repository has any commits. This is determined by checking
    * the objects/info and objects/pack folders.
    * the for loose and packed objects.
    * 
    * @param repository
    * @return true if the repository has commits
    */
   public static boolean hasCommits(Repository repository) {
      if (repository != null && repository.getDirectory().exists()) {
         return (new File(repository.getDirectory(), "objects/info").list().length > 0)
      if (repository != null && repository.getDirectory().exists()) {
         return (new File(repository.getDirectory(), "objects").list().length > 2)
               || (new File(repository.getDirectory(), "objects/pack").list().length > 0);
      }
      return false;
@@ -795,6 +801,9 @@
      return list;
   }
   /**
    * Enumeration of the search types.
    */
   public static enum SearchType {
      AUTHOR, COMMITTER, COMMIT;