MCPcopy Create free account
hub / github.com/libgit2/git2go / checkout

Function checkout

cherrypick_test.go:8–23  ·  view source on GitHub ↗
(t *testing.T, repo *Repository, commit *Commit)

Source from the content-addressed store, hash-verified

6)
7
8func checkout(t *testing.T, repo *Repository, commit *Commit) {
9 tree, err := commit.Tree()
10 if err != nil {
11 t.Fatal(err)
12 }
13
14 err = repo.CheckoutTree(tree, &CheckoutOptions{Strategy: CheckoutSafe})
15 if err != nil {
16 t.Fatal(err)
17 }
18
19 err = repo.SetHeadDetached(commit.Id())
20 if err != nil {
21 t.Fatal(err)
22 }
23}
24
25const content = "Herro, Worrd!"
26

Callers 2

TestCherrypickFunction · 0.85
TestCherrypickCommitFunction · 0.85

Calls 4

TreeMethod · 0.80
CheckoutTreeMethod · 0.80
SetHeadDetachedMethod · 0.80
IdMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…