mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-12 16:35:52 +01:00
Migration for wiki repository configuration in 1.3 which add http.receivepack=true.
This commit is contained in:
@@ -49,7 +49,23 @@ object AutoUpdate {
|
|||||||
* The history of versions. A head of this sequence is the current BitBucket version.
|
* The history of versions. A head of this sequence is the current BitBucket version.
|
||||||
*/
|
*/
|
||||||
val versions = Seq(
|
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, 2),
|
||||||
Version(1, 1),
|
Version(1, 1),
|
||||||
Version(1, 0)
|
Version(1, 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user