(worktree, storage billy.Filesystem)
| 157 | } |
| 158 | |
| 159 | func createDotGitFile(worktree, storage billy.Filesystem) error { |
| 160 | path, err := filepath.Rel(worktree.Root(), storage.Root()) |
| 161 | if err != nil { |
| 162 | path = storage.Root() |
| 163 | } |
| 164 | |
| 165 | if path == GitDirName { |
| 166 | // not needed, since the folder is the default place |
| 167 | return nil |
| 168 | } |
| 169 | |
| 170 | f, err := worktree.Create(GitDirName) |
| 171 | if err != nil { |
| 172 | return err |
| 173 | } |
| 174 | |
| 175 | defer f.Close() |
| 176 | _, err = fmt.Fprintf(f, "gitdir: %s\n", path) |
| 177 | return err |
| 178 | } |
| 179 | |
| 180 | func setConfigWorktree(r *Repository, worktree, storage billy.Filesystem) error { |
| 181 | path, err := filepath.Rel(storage.Root(), worktree.Root()) |
no test coverage detected
searching dependent graphs…