MCPcopy
hub / github.com/Unitech/pm2 / step

Function step

modules/vizion/lib/git/git.js:223–242  ·  view source on GitHub ↗
(folder, which)

Source from the content-addressed store, hash-verified

221};
222
223async function step(folder, which) {
224 await assertGitRepo(folder);
225 const data = {};
226 await getCommitInfo(folder, data);
227 await getBranch(folder, data);
228 await getRemote(folder, data);
229 await isCurrentBranchOnRemote(folder, data);
230 await getPrevNext(folder, data);
231
232 const target = which === 'prev' ? data.prev_rev : data.next_rev;
233 if (target === null || target === undefined) {
234 return { success: false, current_revision: data.revision };
235 }
236 const meta = await git.revert({ folder, revision: target });
237 return {
238 output: meta.output,
239 success: meta.success,
240 current_revision: meta.success ? target : data.revision
241 };
242}
243
244git.prev = function (folder) { return step(folder, 'prev'); };
245git.next = function (folder) { return step(folder, 'next'); };

Callers 1

git.jsFile · 0.85

Calls 6

assertGitRepoFunction · 0.85
getCommitInfoFunction · 0.85
getBranchFunction · 0.85
getRemoteFunction · 0.85
isCurrentBranchOnRemoteFunction · 0.85
getPrevNextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…