MCPcopy
hub / github.com/semantic-release/semantic-release / gitDetachedHead

Function gitDetachedHead

test/helpers/git-utils.js:195–203  ·  view source on GitHub ↗
(repositoryUrl, head)

Source from the content-addressed store, hash-verified

193 * @return {String} The path of the new repository.
194 */
195export async function gitDetachedHead(repositoryUrl, head) {
196 const cwd = temporaryDirectory();
197
198 await execa("git", ["init"], { cwd });
199 await execa("git", ["remote", "add", "origin", repositoryUrl], { cwd });
200 await execa("git", ["fetch", repositoryUrl], { cwd });
201 await execa("git", ["checkout", head], { cwd });
202 return cwd;
203}
204
205export async function gitDetachedHeadFromBranch(repositoryUrl, branch, head) {
206 const cwd = temporaryDirectory();

Callers 2

git.test.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…