Documentation
¶
Index ¶
- Variables
- func GetBranchNames(context context.Context, cmd *cobra.Command, args []string, toComplete string) (names []string, err error)
- type Branch
- func (branch Branch) GetHeaders(cmd *cobra.Command) []string
- func (branch Branch) GetRow(headers []string) []string
- func (branch Branch) GetType() string
- func (branch Branch) MarshalJSON() ([]byte, error)
- func (branch Branch) String() string
- func (branch *Branch) UnmarshalJSON(data []byte) error
- func (branch *Branch) Validate() error
- type BranchReference
- type Branches
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: "branch", Short: "Manage branches", Run: func(cmd *cobra.Command, args []string) { fmt.Println("Branch requires a subcommand:") for _, command := range cmd.Commands() { fmt.Println(command.Name()) } }, }
Command represents this folder's command
Functions ¶
Types ¶
type Branch ¶
type Branch struct {
Name string `json:"name" mapstructure:"name"`
Target commit.Commit `json:"target" mapstructure:"target"`
Links common.Links `json:"links" mapstructure:"links"`
MergeStrategies []string `json:"merge_strategies,omitempty" mapstructure:"merge_strategies"`
DefaultMergeStrategy string `json:"default_merge_strategy,omitempty" mapstructure:"default_merge_strategy"`
}
func GetBranches ¶
GetBranches gets the branches of a repository
func GetCurrentBranch ¶
GetCurrentBranch gets the current branch from Git repository
func (Branch) MarshalJSON ¶
MarshalJSON custom JSON marshalling for Branch
implements json.Marshaler
func (*Branch) UnmarshalJSON ¶
UnmarshalJSON custom JSON unmarshalling for Branch
implements json.Unmarshaler
type BranchReference ¶
type BranchReference struct {
Type string `json:"type" mapstructure:"type"`
Name string `json:"name" mapstructure:"name"`
}
func NewReference ¶
func NewReference(name string) *BranchReference
NewReference creates a new BranchReference
Click to show internal directories.
Click to hide internal directories.