]> source.dussan.org Git - gitblit.git/commitdiff
Ignore the contents of a default .git/description file
authorJames Moger <james.moger@gitblit.com>
Tue, 17 Sep 2013 21:39:10 +0000 (17:39 -0400)
committerJames Moger <james.moger@gitblit.com>
Tue, 17 Sep 2013 21:39:10 +0000 (17:39 -0400)
releases.moxie
src/main/java/com/gitblit/GitBlit.java

index 74cf1e33e97f4f0f7af1bf718bcc1f879f5e046d..33e47c0608f08ec2618712c9565b63cda4028968 100644 (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
index 1afbbc98bfc200a89df67f7114a6b7e9fb1fe5cf..8c0d62dafd29b4227fd65be5bbf8f2948aeba94a 100644 (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", "");