diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2021-10-26 12:31:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 12:31:59 +0200 |
commit | 99457e570d34320b12fb4fcd0f054f3d0b1d3eec (patch) | |
tree | 37d000185d7335402e0a2be17f46203e535a3b0b /options.go | |
parent | 243e7c801995fa0146b3564f41321ca234a8b1d2 (diff) | |
parent | c4b334d4679d6fc38e13b2d84af2d832f6c47566 (diff) | |
download | go-git-99457e570d34320b12fb4fcd0f054f3d0b1d3eec.tar.gz |
Merge pull request #375 from noerw/add-remoteurl-option
Remote: add RemoteURL to {Fetch,Pull,Push}Options
Diffstat (limited to 'options.go')
-rw-r--r-- | options.go | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -91,6 +91,8 @@ func (o *CloneOptions) Validate() error { type PullOptions struct { // Name of the remote to be pulled. If empty, uses the default. RemoteName string + // RemoteURL overrides the remote repo address with a custom URL + RemoteURL string // Remote branch to clone. If empty, uses HEAD. ReferenceName plumbing.ReferenceName // Fetch only ReferenceName if true. @@ -147,7 +149,9 @@ const ( type FetchOptions struct { // Name of the remote to fetch from. Defaults to origin. RemoteName string - RefSpecs []config.RefSpec + // RemoteURL overrides the remote repo address with a custom URL + RemoteURL string + RefSpecs []config.RefSpec // Depth limit fetching to the specified number of commits from the tip of // each remote branch history. Depth int @@ -192,6 +196,8 @@ func (o *FetchOptions) Validate() error { type PushOptions struct { // RemoteName is the name of the remote to be pushed to. RemoteName string + // RemoteURL overrides the remote repo address with a custom URL + RemoteURL string // RefSpecs specify what destination ref to update with what source // object. A refspec with empty src can be used to delete a reference. RefSpecs []config.RefSpec |