mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	WIP: create PR - choose branch
This commit is contained in:
		@@ -33,7 +33,7 @@ func checkContextUser(ctx *middleware.Context, uid int64) *models.User {
 | 
			
		||||
		return ctx.User
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	org, err := models.GetUserById(uid)
 | 
			
		||||
	org, err := models.GetUserByID(uid)
 | 
			
		||||
	if models.IsErrUserNotExist(err) {
 | 
			
		||||
		return ctx.User
 | 
			
		||||
	}
 | 
			
		||||
@@ -112,7 +112,7 @@ func CreatePost(ctx *middleware.Context, form auth.CreateRepoForm) {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if repo != nil {
 | 
			
		||||
		if errDelete := models.DeleteRepository(ctxUser.Id, repo.Id, ctxUser.Name); errDelete != nil {
 | 
			
		||||
		if errDelete := models.DeleteRepository(ctxUser.Id, repo.ID, ctxUser.Name); errDelete != nil {
 | 
			
		||||
			log.Error(4, "DeleteRepository: %v", errDelete)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
@@ -209,7 +209,7 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if repo != nil {
 | 
			
		||||
		if errDelete := models.DeleteRepository(ctxUser.Id, repo.Id, ctxUser.Name); errDelete != nil {
 | 
			
		||||
		if errDelete := models.DeleteRepository(ctxUser.Id, repo.ID, ctxUser.Name); errDelete != nil {
 | 
			
		||||
			log.Error(4, "DeleteRepository: %v", errDelete)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
@@ -239,13 +239,13 @@ func Action(ctx *middleware.Context) {
 | 
			
		||||
	var err error
 | 
			
		||||
	switch ctx.Params(":action") {
 | 
			
		||||
	case "watch":
 | 
			
		||||
		err = models.WatchRepo(ctx.User.Id, ctx.Repo.Repository.Id, true)
 | 
			
		||||
		err = models.WatchRepo(ctx.User.Id, ctx.Repo.Repository.ID, true)
 | 
			
		||||
	case "unwatch":
 | 
			
		||||
		err = models.WatchRepo(ctx.User.Id, ctx.Repo.Repository.Id, false)
 | 
			
		||||
		err = models.WatchRepo(ctx.User.Id, ctx.Repo.Repository.ID, false)
 | 
			
		||||
	case "star":
 | 
			
		||||
		err = models.StarRepo(ctx.User.Id, ctx.Repo.Repository.Id, true)
 | 
			
		||||
		err = models.StarRepo(ctx.User.Id, ctx.Repo.Repository.ID, true)
 | 
			
		||||
	case "unstar":
 | 
			
		||||
		err = models.StarRepo(ctx.User.Id, ctx.Repo.Repository.Id, false)
 | 
			
		||||
		err = models.StarRepo(ctx.User.Id, ctx.Repo.Repository.ID, false)
 | 
			
		||||
	case "desc":
 | 
			
		||||
		if !ctx.Repo.IsOwner() {
 | 
			
		||||
			ctx.Error(404)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user