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

Function assertGitRepo

modules/vizion/lib/git/git.js:26–31  ·  view source on GitHub ↗
(folder)

Source from the content-addressed store, hash-verified

24// Throws if `folder` is not inside a git work tree. Callers turn this into a
25// truthy callback error so God.js can keep walking up parent directories.
26async function assertGitRepo(folder) {
27 const out = await runGit(folder, ['rev-parse', '--is-inside-work-tree']);
28 if (out.trim() !== 'true') {
29 throw new Error('Not a git work tree: ' + folder);
30 }
31}
32
33async function getUrl(folder, data) {
34 // Preserve legacy behavior: the url is the `origin` remote url only.

Callers 2

git.jsFile · 0.85
stepFunction · 0.85

Calls 1

runGitFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…