diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-15 03:51:04 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-15 03:51:04 +0200 |
commit | bcb49927a3897eadc29960032c70da29e26d6b58 (patch) | |
tree | 60025a0a59d15e49c6027b1bfd5d6fee5d5d2438 /options.go | |
parent | f6fe29c80d11662a169806dcf413ecdedcb28fa3 (diff) | |
download | go-git-bcb49927a3897eadc29960032c70da29e26d6b58.tar.gz |
Repository.Clone and Remote.Fetch remote, local branches and client: correct header read
Diffstat (limited to 'options.go')
-rw-r--r-- | options.go | 39 |
1 files changed, 25 insertions, 14 deletions
@@ -5,30 +5,41 @@ import ( "gopkg.in/src-d/go-git.v4/core" ) -// CloneOptions describe how a clone should be perform -type CloneOptions struct { +const ( + // DefaultRemoteName name of the default Remote, just like git command + DefaultRemoteName = "origin" +) + +// RepositoryCloneOptions describe how a clone should be perform +type RepositoryCloneOptions 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 + // Name of the remote to be added, by default `origin` + RemoteName string + // Remote branch to clone ReferenceName core.ReferenceName + // Fetch only ReferenceName if true + SingleBranch bool + // Limit fetching to the specified number of commits + Depth int } -func (o *CloneOptions) Default() { - if o.ReferenceName == "" { - o.ReferenceName = core.HEAD +func (o *RepositoryCloneOptions) Default() { + if o.RemoteName == "" { + o.RemoteName = DefaultRemoteName } -} -// 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 } } + +// RemoteFetchOptions describe how a fetch should be perform +type RemoteFetchOptions struct { + // Remote branchs to fetch + References []*core.Reference + // Limit fetching to the specified number of commits + Depth int +} |