From 79087748f60f9aba219624a0fe9f4d33a0b51236 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Sat, 13 Aug 2016 22:32:34 +0200 Subject: Repository.Clone and Remote.Fetch tests and improvements --- options.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'options.go') 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 + } +} -- cgit