diff options
author | Paulo Gomes <pjbgf@linux.com> | 2023-05-03 08:39:07 +0100 |
---|---|---|
committer | Paulo Gomes <pjbgf@linux.com> | 2023-05-03 08:39:07 +0100 |
commit | 19b39e150071832541f2cdcb669446a8609f57e7 (patch) | |
tree | 86f0f043a8176a790c132d2862f8f3f4565c398e /options.go | |
parent | 0542a302c2be7ed7de276411f7e20b87309734b9 (diff) | |
download | go-git-19b39e150071832541f2cdcb669446a8609f57e7.tar.gz |
git: Add support to ls-remote with peeled references. Fixes #749
A new PeelingOption field was introduced into ListOptions. The new options
include the default (and backwards compatible) IgnorePeeled. Plus another
two variations which either only returns peeled references (OnlyPeeled), or
append peeled references to the list (AppendPeeled).
The ls-remote example was updated to align with upstream, in which peeled
references are appended to the results by default.
A new ErrEmptyUrls error is now returned when List or ListContext do not
receive a URL to work with, to improve overall execution flow.
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
Diffstat (limited to 'options.go')
-rw-r--r-- | options.go | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -624,8 +624,28 @@ type ListOptions struct { InsecureSkipTLS bool // CABundle specify additional ca bundle with system cert pool CABundle []byte + + // PeelingOption defines how peeled objects are handled during a + // remote list. + PeelingOption PeelingOption } +// PeelingOption represents the different ways to handle peeled references. +// +// Peeled references represent the underlying object of an annotated +// (or signed) tag. Refer to upstream documentation for more info: +// https://github.com/git/git/blob/master/Documentation/technical/reftable.txt +type PeelingOption uint8 + +const ( + // IgnorePeeled ignores all peeled reference names. This is the default behavior. + IgnorePeeled PeelingOption = 0 + // OnlyPeeled returns only peeled reference names. + OnlyPeeled PeelingOption = 1 + // AppendPeeled appends peeled reference names to the reference list. + AppendPeeled PeelingOption = 2 +) + // CleanOptions describes how a clean should be performed. type CleanOptions struct { Dir bool |