diff --git a/gogs.go b/gogs.go index ac3b9d1fb..472c2e53b 100644 --- a/gogs.go +++ b/gogs.go @@ -16,7 +16,7 @@ import ( "github.com/gogits/gogs/pkg/setting" ) -const APP_VER = "0.11.43.0330" +const APP_VER = "0.11.44.0409" func init() { setting.AppVer = APP_VER diff --git a/models/pull.go b/models/pull.go index 18a770ebf..de188c098 100644 --- a/models/pull.go +++ b/models/pull.go @@ -221,11 +221,12 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository, mergeStyle os.MkdirAll(path.Dir(tmpBasePath), os.ModePerm) defer os.RemoveAll(path.Dir(tmpBasePath)) - // Clone the base repository to the defined temporary directory. + // Clone the base repository to the defined temporary directory, + // and checks out to base branch directly. var stderr string if _, stderr, err = process.ExecTimeout(5*time.Minute, fmt.Sprintf("PullRequest.Merge (git clone): %s", tmpBasePath), - "git", "clone", baseGitRepo.Path, tmpBasePath); err != nil { + "git", "clone", "-b", pr.BaseBranch, baseGitRepo.Path, tmpBasePath); err != nil { return fmt.Errorf("git clone: %s", stderr) } @@ -253,13 +254,6 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository, mergeStyle switch mergeStyle { case MERGE_STYLE_REGULAR: // Create merge commit - // Check out the base branch to be operated on. - if _, stderr, err = process.ExecDir(-1, tmpBasePath, - fmt.Sprintf("PullRequest.Merge (git checkout): %s", tmpBasePath), - "git", "checkout", pr.BaseBranch); err != nil { - return fmt.Errorf("git checkout '%s': %s", pr.BaseBranch, stderr) - } - // Merge changes from head branch. if _, stderr, err = process.ExecDir(-1, tmpBasePath, fmt.Sprintf("PullRequest.Merge (git merge --no-ff --no-commit): %s", tmpBasePath), diff --git a/templates/.VERSION b/templates/.VERSION index 0ea95244c..dc0b0c9d9 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.11.43.0330 \ No newline at end of file +0.11.44.0409 \ No newline at end of file