diff --git a/src/main/scala/servlet/AutoUpdateListener.scala b/src/main/scala/servlet/AutoUpdateListener.scala index dbfe8cb..4614230 100644 --- a/src/main/scala/servlet/AutoUpdateListener.scala +++ b/src/main/scala/servlet/AutoUpdateListener.scala @@ -44,12 +44,28 @@ */ val versionString = s"${majorVersion}.${minorVersion}" } - + /** * The history of versions. A head of this sequence is the current BitBucket version. */ val versions = Seq( - Version(1, 3), + new Version(1, 3){ + override def update(conn: Connection): Unit = { + super.update(conn) + // Fix wiki repository configuration + val rs = conn.createStatement.executeQuery("SELECT USER_NAME, REPOSITORY_NAME FROM REPOSITORY") + while(rs.next){ + val wikidir = Directory.getWikiRepositoryDir(rs.getString("USER_NAME"), rs.getString("REPOSITORY_NAME")) + val repository = org.eclipse.jgit.api.Git.open(wikidir).getRepository + val config = repository.getConfig + if(!config.getBoolean("http", "receivepack", false)){ + config.setBoolean("http", null, "receivepack", true) + config.save + } + repository.close + } + } + }, Version(1, 2), Version(1, 1), Version(1, 0)