diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-13 22:32:34 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-13 22:32:34 +0200 |
commit | 79087748f60f9aba219624a0fe9f4d33a0b51236 (patch) | |
tree | 1c0d17543ad742d1e97276796140f8b398b74802 /options.go | |
parent | a65bcbc63bef24cf219c63d1b8cfb309c95d1c0f (diff) | |
download | go-git-79087748f60f9aba219624a0fe9f4d33a0b51236.tar.gz |
Repository.Clone and Remote.Fetch tests and improvements
Diffstat (limited to 'options.go')
-rw-r--r-- | options.go | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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 + } +} |