MCPcopy
hub / github.com/go-git/go-git / setWorktreeAndStoragePaths

Function setWorktreeAndStoragePaths

repository.go:140–157  ·  view source on GitHub ↗
(r *Repository, worktree billy.Filesystem)

Source from the content-addressed store, hash-verified

138}
139
140func setWorktreeAndStoragePaths(r *Repository, worktree billy.Filesystem) error {
141 type fsBased interface {
142 Filesystem() billy.Filesystem
143 }
144
145 // .git file is only created if the storage is file based and the file
146 // system is osfs.OS
147 fs, isFSBased := r.Storer.(fsBased)
148 if !isFSBased {
149 return nil
150 }
151
152 if err := createDotGitFile(worktree, fs.Filesystem()); err != nil {
153 return err
154 }
155
156 return setConfigWorktree(r, worktree, fs.Filesystem())
157}
158
159func createDotGitFile(worktree, storage billy.Filesystem) error {
160 path, err := filepath.Rel(worktree.Root(), storage.Root())

Callers 1

InitWithOptionsFunction · 0.85

Calls 3

createDotGitFileFunction · 0.85
setConfigWorktreeFunction · 0.85
FilesystemMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…