aboutsummaryrefslogtreecommitdiffstats
path: root/options.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-13 22:32:34 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-13 22:32:34 +0200
commit79087748f60f9aba219624a0fe9f4d33a0b51236 (patch)
tree1c0d17543ad742d1e97276796140f8b398b74802 /options.go
parenta65bcbc63bef24cf219c63d1b8cfb309c95d1c0f (diff)
downloadgo-git-79087748f60f9aba219624a0fe9f4d33a0b51236.tar.gz
Repository.Clone and Remote.Fetch tests and improvements
Diffstat (limited to 'options.go')
-rw-r--r--options.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/options.go b/options.go
index 300f1a1..c4185ca 100644
--- a/options.go
+++ b/options.go
@@ -11,6 +11,14 @@ type CloneOptions struct {
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
@@ -18,3 +26,9 @@ type FetchOptions struct {
// Remote branch to fetch
ReferenceName core.ReferenceName
}
+
+func (o *FetchOptions) Default() {
+ if o.ReferenceName == "" {
+ o.ReferenceName = core.HEAD
+ }
+}