Use merge operation in gradle (using grgit)

I want to merge a branch into another branch in git using gradle git (grgit) plugin. The branch to be merged is first branch and branch into which the first branch is to be merged is second branch. So, I do a merge operation like this:

def grgit = project.parent.projectDir)
grgit.checkout(branch: ‘origin/first’)
grgit.merge(head:‘origin/second’,mode: org.ajoberstar.grgit.operation.MergeOp.Mode.ONLY_FF)

It builds fine but doesnot do any merge operation. Any idea?