InitBareGoGitRepo creates a new --bare empty git repo at the given path and with the specified LocalStorage namespace. Given a repository path of "~/myrepo" and a namespace of "git-bug", local storage for the GoGitRepo will be configured at "~/myrepo/.git/git-bug".
(path, namespace string)
| 140 | // path of "~/myrepo" and a namespace of "git-bug", local storage for the |
| 141 | // GoGitRepo will be configured at "~/myrepo/.git/git-bug". |
| 142 | func InitBareGoGitRepo(path, namespace string) (*GoGitRepo, error) { |
| 143 | r, err := gogit.PlainInit(path, true) |
| 144 | if err != nil { |
| 145 | return nil, err |
| 146 | } |
| 147 | |
| 148 | k, err := defaultKeyring() |
| 149 | if err != nil { |
| 150 | return nil, err |
| 151 | } |
| 152 | |
| 153 | return &GoGitRepo{ |
| 154 | r: r, |
| 155 | path: path, |
| 156 | clocks: make(map[string]lamport.Clock), |
| 157 | indexes: make(map[string]Index), |
| 158 | keyring: k, |
| 159 | localStorage: billyLocalStorage{Filesystem: osfs.New(filepath.Join(path, namespace))}, |
| 160 | }, nil |
| 161 | } |
| 162 | |
| 163 | func detectGitPath(path string, depth int) (string, error) { |
| 164 | if depth >= 10 { |
nothing calls this directly
no test coverage detected