aboutsummaryrefslogtreecommitdiffstats
path: root/options.go
blob: c4185ca377d5d697323dfae56d4fd7fa0d9d2a9d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package git

import (
	"gopkg.in/src-d/go-git.v3/clients/common"
	"gopkg.in/src-d/go-git.v4/core"
)

// CloneOptions describe how a clone should be perform
type CloneOptions struct {
	// The (possibly remote) repository URL to clone from
	URL string
	// Auth credentials, if required, to uses with the remote repository
	Auth common.AuthMethod
	// Remote branch to fetch
	ReferenceName core.ReferenceName
}

func (o *CloneOptions) Default() {
	if o.ReferenceName == "" {
		o.ReferenceName = core.HEAD
	}
}

// FetchOptions describe how a fetch should be perform
type FetchOptions struct {
	// Remote branch to fetch
	ReferenceName core.ReferenceName
}

func (o *FetchOptions) Default() {
	if o.ReferenceName == "" {
		o.ReferenceName = core.HEAD
	}
}