James Moger
2011-07-18 7e5ee5a454ec396b5dc2f00e89adeca84d6ef683
src/com/gitblit/GitBlit.java
@@ -32,11 +32,13 @@
import org.apache.wicket.protocol.http.WebResponse;
import org.eclipse.jgit.errors.RepositoryNotFoundException;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryCache.FileKey;
import org.eclipse.jgit.lib.StoredConfig;
import org.eclipse.jgit.transport.resolver.FileResolver;
import org.eclipse.jgit.transport.resolver.RepositoryResolver;
import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException;
import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException;
import org.eclipse.jgit.util.FS;
import org.eclipse.jgit.util.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -126,6 +128,20 @@
      return self().settings.getInteger(key, defaultValue);
   }
   /**
    * Returns the char value for the specified key. If the key does not exist
    * or the value for the key can not be interpreted as a character, the
    * defaultValue is returned.
    *
    * @see IStoredSettings.getChar(String key, char defaultValue)
    * @param key
    * @param defaultValue
    * @return key value or defaultValue
    */
   public static char getChar(String key, char defaultValue) {
      return self().settings.getChar(key, defaultValue);
   }
   /**
    * Returns the string value for the specified key. If the key does not exist
    * or the value for the key can not be interpreted as a string, the
@@ -433,7 +449,7 @@
      RepositoryModel model = new RepositoryModel();
      model.name = repositoryName;
      model.hasCommits = JGitUtils.hasCommits(r);
      model.lastChange = JGitUtils.getLastChange(r);
      model.lastChange = JGitUtils.getLastChange(r, null);
      StoredConfig config = JGitUtils.readConfig(r);
      if (config != null) {
         model.description = getConfig(config, "description", "");
@@ -451,6 +467,17 @@
   }
   /**
    * Returns the size in bytes of the repository.
    *
    * @param model
    * @return size in bytes
    */
   public long calculateSize(RepositoryModel model) {
      File gitDir = FileKey.resolve(new File(repositoriesFolder, model.name), FS.DETECTED);
      return com.gitblit.utils.FileUtils.folderSize(gitDir);
   }
   /**
    * Returns the gitblit string vlaue for the specified key. If key is not
    * set, returns defaultValue.
    *