No commit found for revision string:


(sakshi) #1

I want to add the changes of one branch to other branch in the same repo. I am not sure if that means merging the first branch into second.So, I tried this

def grgit = org.ajoberstar.grgit.Grgit.open(dir: project.parent.projectDir)
	grgit.checkout(branch: 'first')
	grgit.fetch()
	grgit.merge(head: 'second')
	grgit.push()

But when I execute the task, I get an error ’ No commit found for revision string’. Any pointers, how can I make this work

enter image description here

stacktrace :

Caused by: org.ajoberstar.grgit.exception.GrgitException: No commit found for revision string: test_dest
    at org.ajoberstar.grgit.util.JGitUtil.resolveObject(JGitUtil.groovy:62)
    at org.ajoberstar.grgit.util.JGitUtil$resolveObject$0.call(Unknown Source)
    at org.ajoberstar.grgit.operation.MergeOp.call(MergeOp.groovy:84)
    at org.ajoberstar.grgit.operation.MergeOp.call(MergeOp.groovy)
    at java_util_concurrent_Callable$call.call(Unknown Source)
    at java_util_concurrent_Callable$call.call(Unknown Source)
    at org.ajoberstar.grgit.util.OpSyntaxUtil.tryOp(OpSyntaxUtil.groovy:45)
    at org.ajoberstar.grgit.Grgit.methodMissing(Grgit.groovy:188)
    at com.vitalconnect.gradle.tasks.PushChangesTask.pushToDest(PushChangesTask.groovy:28)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:227)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 60 more