James Moger
2012-10-30 2a63f699e7e5998e2a037e8f62304bd2be288ea5
src/com/gitblit/GitBlit.java
@@ -1048,6 +1048,16 @@
               }
            }
            
            // rebuild fork networks
            for (RepositoryModel model : repositoryListCache.values()) {
               if (!StringUtils.isEmpty(model.originRepository)) {
                  if (repositoryListCache.containsKey(model.originRepository)) {
                     RepositoryModel origin = repositoryListCache.get(model.originRepository);
                     origin.addFork(model.name);
                  }
               }
            }
            long duration = System.currentTimeMillis() - startTime;
            logger.info(MessageFormat.format(msg, repositoryListCache.size(), duration));
         }
@@ -1445,7 +1455,7 @@
               Constants.CONFIG_GITBLIT, null, "federationSets")));
         model.isFederated = getConfig(config, "isFederated", false);
         model.gcThreshold = getConfig(config, "gcThreshold", settings.getString(Keys.git.defaultGarbageCollectionThreshold, "500KB"));
         model.gcPeriod = getConfig(config, "gcPeriod", settings.getString(Keys.git.defaultGarbageCollectionPeriod, "7 days"));
         model.gcPeriod = getConfig(config, "gcPeriod", settings.getInteger(Keys.git.defaultGarbageCollectionPeriod, 7));
         try {
            model.lastGC = new SimpleDateFormat(Constants.ISO8601).parse(getConfig(config, "lastGC", "1970-01-01'T'00:00:00Z"));
         } catch (Exception e) {
@@ -1730,6 +1740,27 @@
   private boolean getConfig(StoredConfig config, String field, boolean defaultValue) {
      return config.getBoolean(Constants.CONFIG_GITBLIT, field, defaultValue);
   }
   /**
    * Returns the gitblit string value for the specified key. If key is not
    * set, returns defaultValue.
    *
    * @param config
    * @param field
    * @param defaultValue
    * @return field value or defaultValue
    */
   private int getConfig(StoredConfig config, String field, int defaultValue) {
      String value = config.getString(Constants.CONFIG_GITBLIT, null, field);
      if (StringUtils.isEmpty(value)) {
         return defaultValue;
      }
      try {
         return Integer.parseInt(value);
      } catch (Exception e) {
      }
      return defaultValue;
   }
   /**
    * Creates/updates the repository model keyed by reopsitoryName. Saves all
@@ -1896,7 +1927,7 @@
            repository.federationStrategy.name());
      config.setBoolean(Constants.CONFIG_GITBLIT, null, "isFederated", repository.isFederated);
      config.setString(Constants.CONFIG_GITBLIT, null, "gcThreshold", repository.gcThreshold);
      config.setString(Constants.CONFIG_GITBLIT, null, "gcPeriod", repository.gcPeriod);
      config.setInt(Constants.CONFIG_GITBLIT, null, "gcPeriod", repository.gcPeriod);
      if (repository.lastGC != null) {
         config.setString(Constants.CONFIG_GITBLIT, null, "lastGC", new SimpleDateFormat(Constants.ISO8601).format(repository.lastGC));
      }