diff options
author | James Moger <james.moger@gitblit.com> | 2014-05-27 18:13:30 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-06-03 10:34:50 -0400 |
commit | 0047fbba99b804d268a66ed7504a568596de6168 (patch) | |
tree | 4940877475bddebe41d25b9cdced960eb5a107c2 /src/main/java/com/gitblit/servlet/GitblitContext.java | |
parent | e1bcda8c6245035c96bf44ee09d61fa5a52bcafc (diff) | |
download | gitblit-0047fbba99b804d268a66ed7504a568596de6168.tar.gz gitblit-0047fbba99b804d268a66ed7504a568596de6168.zip |
Simplified repository creation with a NewRepositoryPage
Diffstat (limited to 'src/main/java/com/gitblit/servlet/GitblitContext.java')
-rw-r--r-- | src/main/java/com/gitblit/servlet/GitblitContext.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/servlet/GitblitContext.java b/src/main/java/com/gitblit/servlet/GitblitContext.java index 110e553c..50f22d5a 100644 --- a/src/main/java/com/gitblit/servlet/GitblitContext.java +++ b/src/main/java/com/gitblit/servlet/GitblitContext.java @@ -372,6 +372,22 @@ public class GitblitContext extends DaggerContext { } } + // Copy the included gitignore files to the configured gitignore folder + String gitignorePath = webxmlSettings.getString(Keys.git.gitignoreFolder, "gitignore"); + File localGitignores = com.gitblit.utils.FileUtils.resolveParameter(Constants.baseFolder$, base, gitignorePath); + if (!localGitignores.exists()) { + File warGitignores = new File(contextFolder, "/WEB-INF/data/gitignore"); + if (!warGitignores.equals(localGitignores)) { + try { + com.gitblit.utils.FileUtils.copy(localGitignores, warGitignores.listFiles()); + } catch (IOException e) { + logger.error(MessageFormat.format( + "Failed to copy included .gitignore files from {0} to {1}", + warGitignores, localGitignores)); + } + } + } + // merge the WebXmlSettings into the runtime settings (for backwards-compatibilty) runtimeSettings.merge(webxmlSettings); |