diff options
author | Norwin <git@nroo.de> | 2021-09-15 15:34:17 +0200 |
---|---|---|
committer | Norwin <git@nroo.de> | 2021-09-15 15:34:17 +0200 |
commit | 5e64929185218f53cb45b0f89fb372e06aa172be (patch) | |
tree | 07b264601b45b87ac151e7c979b39535240472dd /options.go | |
parent | 4ec1753b4e9324d455d3b55060020ce324e6ced2 (diff) | |
download | go-git-5e64929185218f53cb45b0f89fb372e06aa172be.tar.gz |
Add RemoteURL to {Fetch,Pull,Push}Options
Can be used to override the URL to operate on:
RemoteName will be ignored for the actual fetch
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 |