sync

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package sync implements the pr sync command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdSync

func NewCmdSync(f *cmdutil.Factory, runF func(*SyncOptions) error) *cobra.Command

NewCmdSync creates the pr sync command.

Types

type PRRef

type PRRef struct {
	Owner  string
	Repo   string
	Number int
}

PRRef represents a parsed PR reference

func ParsePRRef

func ParsePRRef(ref string) (*PRRef, error)

ParsePRRef parses a PR reference string

type SyncOptions

type SyncOptions struct {
	IO            *iostreams.IOStreams
	HttpClient    func() (*http.Client, error)
	GetPR         func(*api.Client, string, string, int) (*api.PullRequest, error)
	ListPRCommits func(*api.Client, string, string, int) ([]api.Commit, error)
	GetRepo       func(*api.Client, string, string) (*api.Repository, error)
	CreatePR      func(*api.Client, string, string, *api.CreatePROptions) (*api.PullRequest, error)
	MkdirTemp     func(string, string) (string, error)
	RemoveAll     func(string) error
	WriteFile     func(string, []byte, os.FileMode) error
	RunGitInDir   func(string, string, ...string) (string, error)
	RunGit        func(string, ...string) (string, error)

	SourcePR   string
	TargetRepo string
	Base       string
	Title      string
	Body       string
	Draft      bool
	Yes        bool
	JSON       bool
}

type SyncResult

type SyncResult struct {
	SourcePR      string `json:"source_pr"`
	SourcePRURL   string `json:"source_pr_url"`
	TargetRepo    string `json:"target_repo"`
	TargetBranch  string `json:"target_branch"`
	SyncBranch    string `json:"sync_branch"`
	PRNumber      int    `json:"pr_number,omitempty"`
	PRURL         string `json:"pr_url,omitempty"`
	CommitsSynced int    `json:"commits_synced"`
	ConflictError string `json:"conflict_error,omitempty"`
}

Source Files

  • sync.go

Jump to

Keyboard shortcuts

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