Worktree returns a worktree based on the given fs, if nil the default worktree will be used.
()
| 1517 | // Worktree returns a worktree based on the given fs, if nil the default |
| 1518 | // worktree will be used. |
| 1519 | func (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 | |
| 1527 | func expand_ref(s storer.ReferenceStorer, ref plumbing.ReferenceName) (*plumbing.Reference, error) { |
| 1528 | // For improving troubleshooting, this preserves the error for the provided `ref`, |
no outgoing calls