diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-04-22 18:35:41 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-04-22 18:35:41 -0400 |
commit | 444f0564fbe0d25f5cad52cb6899b2c2ad9f1cf7 (patch) | |
tree | 0f6557c2275ffc23fef073ad0976a791a5b4e4b7 | |
parent | cbcc79012d44e6b7e79583d078409628b8834a69 (diff) | |
download | b4-444f0564fbe0d25f5cad52cb6899b2c2ad9f1cf7.tar.gz |
Properly deal with merge to non-current branch
When running rev-list, be mindful of which branch we need to operate on,
otherwise it always runs on the current branch.
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/ty.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -51,9 +51,11 @@ MY_COMMITS = None BRANCH_INFO = None -def git_get_merge_id(gitdir, commit_id): +def git_get_merge_id(gitdir, commit_id, branch=None): # get merge commit id args = ['rev-list', '%s..' % commit_id, '--ancestry-path'] + if branch is not None: + args += [branch] lines = b4.git_get_command_lines(gitdir, args) if not len(lines): return None @@ -117,7 +119,7 @@ def auto_locate_pr(gitdir, jsondata, branch): return None # Get the merge commit - merge_commit_id = git_get_merge_id(gitdir, pr_commit_id) + merge_commit_id = git_get_merge_id(gitdir, pr_commit_id, branch) if not merge_commit_id: logger.debug('Could not get a merge commit-id for %s', pr_commit_id) return None |