summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-09-17 17:39:10 -0400
committerJames Moger <james.moger@gitblit.com>2013-09-17 17:39:10 -0400
commit557a1fa25a0a1d60bdb71ea3ad0e4e9a9cd9cc61 (patch)
tree0fa1cbf7f4d22c431b4330868e9b12c69e6b0914
parentf084f468756bde745d8e8e27c729f6e57bea5749 (diff)
downloadgitblit-557a1fa25a0a1d60bdb71ea3ad0e4e9a9cd9cc61.tar.gz
gitblit-557a1fa25a0a1d60bdb71ea3ad0e4e9a9cd9cc61.zip
Ignore the contents of a default .git/description file
-rw-r--r--releases.moxie1
-rw-r--r--src/main/java/com/gitblit/GitBlit.java6
2 files changed, 5 insertions, 2 deletions
diff --git a/releases.moxie b/releases.moxie
index 74cf1e33..33e47c06 100644
--- a/releases.moxie
+++ b/releases.moxie
@@ -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
diff --git a/src/main/java/com/gitblit/GitBlit.java b/src/main/java/com/gitblit/GitBlit.java
index 1afbbc98..8c0d62da 100644
--- a/src/main/java/com/gitblit/GitBlit.java
+++ b/src/main/java/com/gitblit/GitBlit.java
@@ -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", "");