Ignore the contents of a default .git/description file
diff --git a/releases.moxie b/releases.moxie
index 74cf1e3..33e47c0 100644
--- a/releases.moxie
+++ b/releases.moxie
@@ -11,6 +11,7 @@
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
diff --git a/src/main/java/com/gitblit/GitBlit.java b/src/main/java/com/gitblit/GitBlit.java
index 1afbbc9..8c0d62d 100644
--- a/src/main/java/com/gitblit/GitBlit.java
+++ b/src/main/java/com/gitblit/GitBlit.java
@@ -1990,8 +1990,10 @@
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", "");