mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-26 12:27:06 +00:00 
			
		
		
		
	Fix #819 by fetching the repository from db before updating
This commit is contained in:
		| @@ -507,6 +507,11 @@ func initRepository(f string, u *User, repo *Repository, initReadme bool, repoLa | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if len(fileName) == 0 { | 	if len(fileName) == 0 { | ||||||
|  | 		// re-fetch the repository from database before updating it (else it would | ||||||
|  | 		// override changes that were done earlier with sql) | ||||||
|  | 		if _, err := x.Get(repo); err != nil { | ||||||
|  | 			return err | ||||||
|  | 		} | ||||||
| 		repo.IsBare = true | 		repo.IsBare = true | ||||||
| 		repo.DefaultBranch = "master" | 		repo.DefaultBranch = "master" | ||||||
| 		return UpdateRepository(repo) | 		return UpdateRepository(repo) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Peter Smit
					Peter Smit