if (cfg.getFile().exists()) {
throw new IllegalStateException(MessageFormat.format(
JGitText.get().repositoryAlreadyExists, getDirectory()));
}
FileUtils.mkdirs(getDirectory(), true);
HideDotFiles hideDotFiles = getConfig().getEnum(
ConfigConstants.CONFIG_CORE_SECTION, null,
ConfigConstants.CONFIG_KEY_HIDEDOTFILES,
HideDotFiles.DOTGITONLY);
if (hideDotFiles != HideDotFiles.FALSE && !isBare())
getFS().setHidden(getDirectory(), true);