This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository scmwebeditor. See http://git.nuiton.org/scmwebeditor.git commit c7b7c06fab37b098794390776c87175e9e428474 Author: Hugo PIGEON <hpigeon@codelutin.com> Date: Tue Jun 2 17:28:35 2015 +0200 When creating a new directory on Git repositories, the automatically created file is named "placeholder" and it contains an information message --- .../java/org/nuiton/scmwebeditor/git/GitFileManager.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitFileManager.java b/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitFileManager.java index edeebc8..f6b665e 100644 --- a/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitFileManager.java +++ b/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitFileManager.java @@ -48,6 +48,10 @@ public class GitFileManager implements ScmFileManager { private static final Log log = LogFactory.getLog(GitFileManager.class); + protected static String PLACEHOLDER_MESSAGE = "This file has been automatically added by SCMWebEditor when you " + + "created its directory.\nGit repositories require at least one file per directory, so this file was created " + + "according to this rule.\nYou can remove this file once you have added other files in this directory."; + /** the connection to the Git repository */ GitConnection connection; @@ -423,11 +427,11 @@ public class GitFileManager implements ScmFileManager { File file = new File(connection.getLocalDirectory().getAbsolutePath() + File.separator + pathOnRepo + File.separator + dto.getDirectoryName()); file.mkdir(); - File emptyFile = new File(file.getAbsolutePath() + File.separator + ".gitignore"); + File emptyFile = new File(file.getAbsolutePath() + File.separator + "placeholder"); try { emptyFile.createNewFile(); - FileUtils.writeStringToFile(emptyFile, " "); + FileUtils.writeStringToFile(emptyFile, PLACEHOLDER_MESSAGE); } catch (IOException e) { if (log.isErrorEnabled()) { log.error("Can not create file '" + emptyFile.getAbsolutePath() + "'"); @@ -453,9 +457,9 @@ public class GitFileManager implements ScmFileManager { String toAdd; if (pathOnRepo.equals("")) { - toAdd = dto.getDirectoryName() + "/.gitignore"; + toAdd = dto.getDirectoryName() + "/placeholder"; } else { - toAdd = pathOnRepo + "/" + dto.getDirectoryName() + "/.gitignore"; + toAdd = pathOnRepo + "/" + dto.getDirectoryName() + "/placeholder"; } add.addFilepattern(toAdd); -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.