gitcontext

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindPRForBranch

func FindPRForBranch(owner, repo, branch string) (int, error)

FindPRForBranch finds an open PR for the given branch in the repository. Returns 0 if no open PR exists for the branch.

Types

type Context

type Context struct {
	Owner  string
	Repo   string
	Branch string
}

Context holds detected git repository information.

func Detect

func Detect() (*Context, error)

Detect attempts to detect git context from the current directory. Returns an error if not in a git repository or detection fails.

func (*Context) FullName added in v0.4.0

func (c *Context) FullName() string

func (*Context) Resolve

func (c *Context) Resolve() (*Result, error)

Resolve determines what pull action to take based on the git context.

type Result

type Result struct {
	Owner     string
	Repo      string
	PRNumber  int  // >0 if current branch has an open PR
	IsDefault bool // true if on main/master branch
}

Result holds the resolved action to take based on git context.

Jump to

Keyboard shortcuts

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