mirror of
https://github.com/grdl/git-get.git
synced 2026-02-06 12:12:58 +00:00
Implement ignoreExisting flag and set default branch also for dump cloning
This commit is contained in:
@@ -73,6 +73,11 @@ func Clone(opts *CloneOpts) (*Repo, error) {
|
||||
|
||||
repo, err := git.PlainClone(opts.Path, false, gitOpts)
|
||||
if err != nil {
|
||||
|
||||
if opts.IgnoreExisting && errors.Is(err, git.ErrRepositoryAlreadyExists) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return nil, errors.Wrap(err, "Failed cloning repo")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user