PutConfig: Reload project config before returning response

The response returned after updating the configuration was generated
using the configuration that was loaded before the update, and did
not contain the changed values.

Change-Id: I70fe53859e6cd2be478f9d72f29f49e9b6b97046
diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/project/ProjectIT.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/project/ProjectIT.java
index e8c1f06..272e2c5 100644
--- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/project/ProjectIT.java
+++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/project/ProjectIT.java
@@ -153,15 +153,15 @@
     ConfigInput input = new ConfigInput();
     input.maxObjectSizeLimit = "100k";
     ConfigInfo info = setConfig(input);
-    assertThat(info.maxObjectSizeLimit.value).isNull(); // TODO: Should be "100k"
+    assertThat(info.maxObjectSizeLimit.value).isEqualTo("100k");
     assertThat(info.maxObjectSizeLimit.configuredValue).isEqualTo("100k");
     assertThat(info.maxObjectSizeLimit.inheritedValue).isNull();
 
     // Clear the value
     input.maxObjectSizeLimit = "0";
     info = setConfig(input);
-    assertThat(info.maxObjectSizeLimit.value).isEqualTo("0"); // TODO: Should be null
-    assertThat(info.maxObjectSizeLimit.configuredValue).isEqualTo("0"); // TODO: Should be null
+    assertThat(info.maxObjectSizeLimit.value).isNull();
+    assertThat(info.maxObjectSizeLimit.configuredValue).isNull();
     assertThat(info.maxObjectSizeLimit.inheritedValue).isNull();
   }
 
@@ -196,7 +196,7 @@
     ConfigInput input = new ConfigInput();
     input.maxObjectSizeLimit = "100k";
     ConfigInfo info = setConfig(input);
-    assertThat(info.maxObjectSizeLimit.value).isEqualTo("200k"); // TODO: Should be "100k"
+    assertThat(info.maxObjectSizeLimit.value).isEqualTo("100k");
     assertThat(info.maxObjectSizeLimit.configuredValue).isEqualTo("100k");
     assertThat(info.maxObjectSizeLimit.inheritedValue).isEqualTo("200k");
   }
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/PutConfig.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/PutConfig.java
index a7e6d10..e0fff4d 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/PutConfig.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/PutConfig.java
@@ -172,7 +172,7 @@
         throw new ResourceConflictException("Cannot update " + projectName, e);
       }
 
-      ProjectState state = projectStateFactory.create(projectConfig);
+      ProjectState state = projectStateFactory.create(ProjectConfig.read(md));
       return new ConfigInfoImpl(
           serverEnableSignedPush,
           state.controlFor(user.get()),