Browse Source

Ignore the contents of a default .git/description file

tags/v1.4.0
James Moger 10 years ago
parent
commit
557a1fa25a
2 changed files with 5 additions and 2 deletions
  1. 1
    0
      releases.moxie
  2. 4
    2
      src/main/java/com/gitblit/GitBlit.java

+ 1
- 0
releases.moxie View File

@@ -11,6 +11,7 @@ r20: {
security: ~
fixes:
- Fix potential NPE on removing uncached repository from cache
- Ignore the default contents of .git/description file
changes:
- Personal repository prefix (~) is now configurable (issue-265)
- Updated default binary and Lucene ignore extensions

+ 4
- 2
src/main/java/com/gitblit/GitBlit.java View File

@@ -1990,8 +1990,10 @@ public class GitBlit implements ServletContextListener {
if (getConfig(config,"description", null) == null) {
File descFile = new File(r.getDirectory(), "description");
if (descFile.exists()) {
config.setString(Constants.CONFIG_GITBLIT, null, "description",
com.gitblit.utils.FileUtils.readContent(descFile, System.getProperty("line.separator")));
String desc = com.gitblit.utils.FileUtils.readContent(descFile, System.getProperty("line.separator"));
if (!desc.toLowerCase().startsWith("unnamed repository")) {
config.setString(Constants.CONFIG_GITBLIT, null, "description", desc);
}
}
}
model.description = getConfig(config, "description", "");

Loading…
Cancel
Save