aboutsummaryrefslogtreecommitdiffstats
path: root/options.go
diff options
context:
space:
mode:
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
+ }
+}