Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Check if a commit is a merge commit - Bitbucket scriptrunner

Narasimha Velagaleti November 28, 2018

How do I verify if a commit is a merge commit of a pull request using groovy scriptrunner for bitbucket server?

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
majensen January 28, 2020

You just need to check the length of the `parents`. If there are two or more commits, it's a merge commit, otherwise it's a regular commit.

 

```commit.getParents().size() >= 2```

TAGS
AUG Leaders

Atlassian Community Events