コード例 #1
0
ファイル: GitVcsSupport.java プロジェクト: idlsoft/git-plugin
  @NotNull
  @Override
  public Map<String, String> getCheckoutProperties(@NotNull VcsRoot root) throws VcsException {
    Map<String, String> defaults = getDefaultVcsProperties();
    Set<String> significantProps =
        setOf(
            Constants.FETCH_URL,
            Constants.SUBMODULES_CHECKOUT,
            Constants.AGENT_CLEAN_POLICY,
            Constants.AGENT_CLEAN_FILES_POLICY);
    Map<String, String> rootProperties = root.getProperties();
    Map<String, String> repositoryProperties = new HashMap<String, String>();
    for (String key : significantProps) {
      String defVal = defaults.get(key);
      String actualVal = rootProperties.get(key);
      repositoryProperties.put(key, actualVal == null ? defVal : actualVal);
    }

    // include autocrlf settings only for non-default value
    // in order to avoid clean checkout
    if ("true".equals(rootProperties.get(Constants.SERVER_SIDE_AUTO_CRLF)))
      repositoryProperties.put(
          Constants.SERVER_SIDE_AUTO_CRLF, rootProperties.get(Constants.SERVER_SIDE_AUTO_CRLF));

    return repositoryProperties;
  }