From 21d8d7e95144eca38e93120b575c0ebd436e0e24 Mon Sep 17 00:00:00 2001 From: Thibault Jamet Date: Tue, 1 Jun 2021 23:33:46 +0200 Subject: [PATCH] Document the push refspec format Taken from `git help push` and adapted to match the supported features only. Future iterations of this feature may include better support for git "SHA-1 expression", documented in `git help push` as: > any arbitrary "SHA-1 expression", such as master~4 or HEAD (see gitrevisions(7)). --- options.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/options.go b/options.go index 3bd687650..b71299b5a 100644 --- a/options.go +++ b/options.go @@ -198,8 +198,14 @@ type PushOptions struct { 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 specify what destination ref to update with what source object. + // + // The format of a parameter is an optional plus +, followed by + // the source object , followed by a colon :, followed by the destination ref . + // The is often the name of the branch you would want to push, but it can be a SHA-1. + // The tells which ref on the remote side is updated with this push. + // + // A refspec with empty src can be used to delete a reference. RefSpecs []config.RefSpec // Auth credentials, if required, to use with the remote repository. Auth transport.AuthMethod