I am trying to merge a branch using the NodeJS SDK for the Azure DevOps REST API.
I have the following typescript code using the Azure DevOps Node SDK (https://www.npmjs.com/package/azure-devops-node-api)
// get master commit
const masterRef = (await gitApi.getRefs(repository.id!, devOps.projectName, 'heads/master'))[0];
// merge branch into master
let merge = await gitApi.createMergeRequest(
{
comment: 'Merge',
parents: [branchLatestCommitId, masterRef.objectId!]
},
devOps.projectName,
repository.id!
);
And I can see in the console when I print the result of the merge object (with a status of 3, indicating Completed):
Object
comment: "Merge"
detailedStatus: {mergeCommitId: "faaeb4adef7640d9dac56592ef96e2535dd46078"}
mergeOperationId: 38
parents: (2) ["67f62907ec3ab10afc8452a649bf010e02d38af9", "8ac25ac12c7e9b28195aa64ed7a23d3939a3491d"]
status: 3
__proto__: Object
Alas...nothing has changed in my git repository. The branch is still there, unmerged into master.