From e09d4bb6558c7b6c59dec3911138aaaa2a0f4597 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Fri, 15 Jun 2012 08:26:19 -0400
Subject: [PATCH] Fixed bug where Manager could not update unreferenced setting (issue 85)

---
 src/com/gitblit/GitBlit.java |    8 ++++++--
 docs/04_releases.mkd         |    3 +++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/docs/04_releases.mkd b/docs/04_releases.mkd
index 342d67b..8db8f7b 100644
--- a/docs/04_releases.mkd
+++ b/docs/04_releases.mkd
@@ -8,6 +8,7 @@
 
 - Fixed bug where a repository set as authenticated push did not have anonymous clone access (issue 96)
 - Fixed bug in Basic authentication if passwords had a colon (Github/peterloron)
+- Fixed bug where the Gitblit Manager could not update a setting that was not referenced in reference.properties (issue 85)
 
 #### changes
 
@@ -17,6 +18,8 @@
 
 #### additions
 
+- Added setting to allow specification of a robots.txt file (issue 99)  
+    **New:** *web.robots.txt = *  
 - Added setting to control responsive or fixed-width layout (issue 101)  
     **New:** *web.useResponsiveLayout = true*  
 - Added setting to control charsets for blob string decoding.  Default encodings are UTF-8, ISO-8859-1, and server's default charset. (issue 97)  
diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java
index dc53540..eab265a 100644
--- a/src/com/gitblit/GitBlit.java
+++ b/src/com/gitblit/GitBlit.java
@@ -1823,9 +1823,13 @@
 		// ensure that the current values are updated in the setting models
 		for (String key : settings.getAllKeys(null)) {
 			SettingModel setting = settingsModel.get(key);
-			if (setting != null) {
-				setting.currentValue = settings.getString(key, "");
+			if (setting == null) {
+				// unreferenced setting, create a setting model
+				setting = new SettingModel();
+				setting.name = key;
+				settingsModel.add(setting);
 			}
+			setting.currentValue = settings.getString(key, "");			
 		}
 		settingsModel.pushScripts = getAllScripts();
 		return settingsModel;

--
Gitblit v1.9.1