MCPcopy Create free account
hub / github.com/go-git/go-git / Worktree

Method Worktree

repository.go:1519–1525  ·  view source on GitHub ↗

Worktree returns a worktree based on the given fs, if nil the default worktree will be used.

()

Source from the content-addressed store, hash-verified

1517// Worktree returns a worktree based on the given fs, if nil the default
1518// worktree will be used.
1519func (r *Repository) Worktree() (*Worktree, error) {
1520 if r.wt == nil {
1521 return nil, ErrIsBareRepository
1522 }
1523
1524 return &Worktree{r: r, Filesystem: r.wt}, nil
1525}
1526
1527func expand_ref(s storer.ReferenceStorer, ref plumbing.ReferenceName) (*plumbing.Reference, error) {
1528 // For improving troubleshooting, this preserves the error for the provided `ref`,

Callers 15

cloneMethod · 0.95
createCommitFunction · 0.80
TestCloneSparseMethod · 0.80
TestMergeFFMethod · 0.80
TestMergeFF_InvalidMethod · 0.80
TestPushDepthMethod · 0.80
TestWorktreeMethod · 0.80

Calls

no outgoing calls

Tested by 15

createCommitFunction · 0.64
TestCloneSparseMethod · 0.64
TestMergeFFMethod · 0.64
TestMergeFF_InvalidMethod · 0.64
TestPushDepthMethod · 0.64
TestWorktreeMethod · 0.64
TestWorktreeBareMethod · 0.64