Merge branch 'master' of https://github.com/go-gitea/gitea
Signed-off-by: Konrad <konrad@kola-entertainments.de> # Conflicts: # models/migrations/migrations.go # models/migrations/v46.go # models/repo.go # public/js/index.js
This commit is contained in:
parent
30fe97a55e
commit
751bbee534
|
|
@ -1 +1,34 @@
|
|||
// Copyright 2017 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-xorm/xorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
func addIssueDependencyTables(x *xorm.Engine) (err error) {
|
||||
|
||||
type IssueDependency struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
UserID int64 `xorm:"UNIQUE(watch) NOT NULL"`
|
||||
IssueID int64 `xorm:"UNIQUE(watch) NOT NULL"`
|
||||
DependencyID int64 `xorm:"UNIQUE(watch) NOT NULL"`
|
||||
Created time.Time `xorm:"-"`
|
||||
CreatedUnix int64 `xorm:"INDEX created"`
|
||||
Updated time.Time `xorm:"-"`
|
||||
UpdatedUnix int64 `xorm:"updated"`
|
||||
}
|
||||
|
||||
err = x.Sync(new(IssueDependency))
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error creating issue_dependency_table column definition: %v", err)
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2453,40 +2453,6 @@ func (repo *Repository) GetUserFork(userID int64) (*Repository, error) {
|
|||
return &forkedRepo, nil
|
||||
}
|
||||
|
||||
// __________ .__
|
||||
// \______ \____________ ____ ____ | |__
|
||||
// | | _/\_ __ \__ \ / \_/ ___\| | \
|
||||
// | | \ | | \// __ \| | \ \___| Y \
|
||||
// |______ / |__| (____ /___| /\___ >___| /
|
||||
// \/ \/ \/ \/ \/
|
||||
//
|
||||
|
||||
// CreateNewBranch creates a new repository branch
|
||||
func (repo *Repository) CreateNewBranch(doer *User, oldBranchName, branchName string) (err error) {
|
||||
repoWorkingPool.CheckIn(com.ToStr(repo.ID))
|
||||
defer repoWorkingPool.CheckOut(com.ToStr(repo.ID))
|
||||
|
||||
localPath := repo.LocalCopyPath()
|
||||
|
||||
if err = discardLocalRepoBranchChanges(localPath, oldBranchName); err != nil {
|
||||
return fmt.Errorf("discardLocalRepoChanges: %v", err)
|
||||
} else if err = repo.UpdateLocalCopyBranch(oldBranchName); err != nil {
|
||||
return fmt.Errorf("UpdateLocalCopyBranch: %v", err)
|
||||
}
|
||||
|
||||
if err = repo.CheckoutNewBranch(oldBranchName, branchName); err != nil {
|
||||
return fmt.Errorf("CreateNewBranch: %v", err)
|
||||
}
|
||||
|
||||
if err = git.Push(localPath, git.PushOptions{
|
||||
Remote: "origin",
|
||||
Branch: branchName,
|
||||
}); err != nil {
|
||||
return fmt.Errorf("Push: %v", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Get Blocked By Dependencies, aka all issues this issue is blocked by.
|
||||
func (repo *Repository) getBlockedByDependencies(e Engine, issueID int64) (_ []*IssueDependencyIssue, err error) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user