| 247 | } |
| 248 | |
| 249 | func Clone(ctx context.Context, path string, c *Config) (*git.Repository, error) { |
| 250 | return git.PlainCloneContext(ctx, path, false, &git.CloneOptions{ |
| 251 | URL: c.Remote, |
| 252 | RemoteName: c.RemoteName(), |
| 253 | Auth: &githttp.BasicAuth{Username: c.Username, Password: c.Password}, |
| 254 | ReferenceName: plumbing.NewBranchReferenceName(c.DefaultBranch), |
| 255 | SingleBranch: true, |
| 256 | }) |
| 257 | } |
| 258 | |
| 259 | func NativeGitSignature(ctx context.Context, path string) (*object.Signature, error) { |
| 260 | repo, err := git.PlainOpen(path) |