I'm writing the code based on this example, but would like to use correct upstream that has been set up for the branch.
const branch = await repo.getCurrentBranch();
const branchRefspec = branch.name();
const remoteRefspec = await Git.Branch.upstream(branch);
const remote = await repo.getRemote('origin');
await remote.push(
[`${branchRefspec}:${remoteRefspec}`],
{
callbacks: {
credentials: verifyUser,
},
},
);
For some reason, this code does nothing. I couldn't find any documentation on what exactly does this parameter has to be, and what goes after the semicolon. Whatever it is, it doesn't look like good old git's refspecs.
If the refspec is left the way it is in example (i.e. from and into the same branch) somehow it works.
Why this code doesn't work? What refspec should I pass there and why?