refs

package
v4.4.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// contains filtered or unexported fields
}

Info contains all refs info

func Parse

func Parse(data []byte) (*Info, error)

Parse parse data and return refs struct and error

func (*Info) BranchList

func (r *Info) BranchList() []string

BranchList returns slice of branch names

func (*Info) GetBranchSHA

func (r *Info) GetBranchSHA(name string, short bool) string

GetBranchSHA returns SHA for given branch

func (*Info) GetTagSHA

func (r *Info) GetTagSHA(name string, short bool) string

GetTagSHA returns SHA for given tag

func (*Info) HasBranch

func (r *Info) HasBranch(name string) bool

HasBranch returns true if branch with given name is exist in repo

func (*Info) HasTag

func (r *Info) HasTag(name string) bool

HasTag returns true if tag with given name is exist in repo

func (*Info) Rewrite

func (r *Info) Rewrite(headName string, headType RefType) []byte

Rewrite returns refs with updated head

func (*Info) TagList

func (r *Info) TagList() []string

TagList returns slice of tag names

type RefType

type RefType uint8

RefType is type for refs

const (
	TYPE_UNKNOWN RefType = iota
	TYPE_BRANCH
	TYPE_TAG
)

Types info

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL