You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2015/05/20 23:37:35 UTC
[2/9] allura git commit: [#7836] ticket:739 Fetch target branch
before finding merge base
[#7836] ticket:739 Fetch target branch before finding merge base
Because if we don't, we get 0 commits if target branch name and source branch
name are the same, even if branches actually differ.
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/0e365071
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/0e365071
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/0e365071
Branch: refs/heads/master
Commit: 0e365071cf76e24727fd5e2ade6c08a3df2bea17
Parents: a96649c
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Mar 5 16:34:20 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed May 20 19:43:16 2015 +0000
----------------------------------------------------------------------
ForgeGit/forgegit/model/git_repo.py | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/0e365071/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 5994cd2..a0f3f5a 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -632,12 +632,9 @@ class GitImplementation(M.RepositoryImplementation):
}
def merge_base(self, mr):
- # We don't need to fetch latest commits from target branch here,
- # because merge base will always be a commit that both repos have
- # seen
- return self._git.git.merge_base(
- mr.downstream.commit_id,
- mr.target_branch)
+ g = self._git.git
+ g.fetch(mr.app.repo.full_fs_path, mr.target_branch)
+ return g.merge_base(mr.downstream.commit_id, 'FETCH_HEAD')
class _OpenedGitBlob(object):