summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/gitblit/StoredUserConfig.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/com/gitblit/StoredUserConfig.java b/src/main/java/com/gitblit/StoredUserConfig.java
index eae1d3cf..63e1015c 100644
--- a/src/main/java/com/gitblit/StoredUserConfig.java
+++ b/src/main/java/com/gitblit/StoredUserConfig.java
@@ -73,7 +73,12 @@ public class StoredUserConfig {
}
private static void writeSection(PrintWriter printWriter, String key, Section section) {
- printWriter.printf("[%s \"%s\"]\n", section.getName(), section.getSubSection());
+ if (section.getSubSection() == null) {
+ printWriter.printf("[%s]\n", section.getName());
+ }
+ else {
+ printWriter.printf("[%s \"%s\"]\n", section.getName(), section.getSubSection());
+ }
for (Entry entry : section.getEntries().values()) {
writeEntry(printWriter, entry.getKey(), entry.getValue());
}
@@ -90,7 +95,7 @@ public class StoredUserConfig {
}
private static String generateKey(String key, String subKey) {
- return "k:" + key + "s:" + subKey;
+ return "k:" + key + "s:" + (subKey == null ? "" : subKey);
}
private static class Section {