(r *Repository, worktree billy.Filesystem)
| 138 | } |
| 139 | |
| 140 | func 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 | |
| 159 | func createDotGitFile(worktree, storage billy.Filesystem) error { |
| 160 | path, err := filepath.Rel(worktree.Root(), storage.Root()) |
no test coverage detected
searching dependent graphs…