treedetector

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToStackTree

func ConvertToStackTree(pieces map[plumbing.ReferenceName]*BranchPiece, currentBranch plumbing.ReferenceName, sortCurrent bool) []*stackutils.StackTreeNode

ConvertToStackTree converts the branch pieces to a tree structure.

func DetectBranchTree

func DetectBranchTree(repo *git.Repository, remoteName string, trunkBranches []plumbing.ReferenceName) (map[plumbing.ReferenceName]*BranchPiece, error)

func GetChildren

GetChildren returns the children of the given branch.

func GetStackRoot

GetStackRoot returns the root of the stack of branches from the given branch. It returns an empty string if the stack root cannot be detected.

Types

type BranchPiece

type BranchPiece struct {
	Name plumbing.ReferenceName

	// If any of these are set, Parent, ParentIsTrunk, ParentMergeBase, and IncludedCommits are
	// unset.
	PossibleParents     []plumbing.ReferenceName
	ContainsMergeCommit bool

	Parent          plumbing.ReferenceName
	ParentIsTrunk   bool
	ParentMergeBase plumbing.Hash
	IncludedCommits []*object.Commit
}

func GetPossibleChildren

func GetPossibleChildren(pieces map[plumbing.ReferenceName]*BranchPiece, branch plumbing.ReferenceName) []*BranchPiece

GetPossibleChildren returns the possible children of the given branch.

Jump to

Keyboard shortcuts

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