Fix return codes of create-repo.sh CGI-script

The create-repo.sh CGI-script in the apache-git-http-backend container,
which could be used to trigger the creation of new repositories was not
correctly setting the return code in the response header. This is fixed
in this change.

Change-Id: Id6aef1dd8b0535d09d018675ee7cf54cc77e2a80
diff --git a/container-images/apache-git-http-backend/tools/create_repo.sh b/container-images/apache-git-http-backend/tools/create_repo.sh
index 109e46a..bac1b21 100755
--- a/container-images/apache-git-http-backend/tools/create_repo.sh
+++ b/container-images/apache-git-http-backend/tools/create_repo.sh
@@ -1,24 +1,22 @@
 #!/bin/bash
 
 echo "Content-type: text/html"
-echo ""
-
 REPO=${REQUEST_URI##/new/}
 
 if [[ "${REPO}" != *".git" ]]; then
     REPO="${REPO}.git"
 fi
 
-git init --bare /var/gerrit/git/${REPO} > /dev/null || \
-    {
-        echo "Status: 400 Repository could not be created."
-        exit 1
-    }
+STATUS_CODE="500 Internal Server Error"
+MESSAGE="Repository could not be created."
+
+git init --bare /var/gerrit/git/${REPO} > /dev/null
 
 if test -f /var/gerrit/git/${REPO}/HEAD; then
-    echo "Status: 201 Created repository ${REPO}"
-    exit 0
-else
-    echo "Status: 400 Repository could not be created."
-    exit 1
+    STATUS_CODE="201 Created"
+    MESSAGE="Repository successfully created."
 fi
+
+echo "Status: ${STATUS_CODE}"
+echo ""
+echo "${MESSAGE}"