Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BranchMetadata ¶
BranchMetadata is metadata about a given branch. TODO: Delete this type alias and just use meta.Branch.
type SyncBranchOpts ¶
type SyncBranchOpts struct { // The branch that is being synced (this should already be checked out). Branch string // The name of the parent branch Parent string // The base commit to use for the rebase (every commit *after* this one // will be replayed onto Parent). Base string // The strategy for performing the sync. // If the branch is already up-to-date, the sync will be a no-op and // strategy will be ignored. Strategy SyncStrategy }
type SyncResult ¶
type SyncResult struct { Status SyncStatus Hint string }
SyncResult is the result of a SyncBranch operation.
func SyncBranch ¶
func SyncBranch( repo *git.Repo, opts *SyncBranchOpts, ) (*SyncResult, error)
SyncBranch synchronizes the currently checked-out branch with the parent. The target branch is said to be already synchronized (up-to-date) if the target branch contains all the commits from the parent branch.
func SyncContinue ¶
func SyncContinue(repo *git.Repo, strategy SyncStrategy) (*SyncResult, error)
type SyncStatus ¶
type SyncStatus int
const ( // SyncAlreadyUpToDate indicates that the sync was a no-op because the // target branch was already up-to-date with its parent. SyncAlreadyUpToDate SyncStatus = iota // SyncUpdated indicates that the sync updated the target branch // (i.e., created a merge commit or performed a rebase). SyncUpdated SyncStatus = iota // SyncConflict indicates that there was a conflict while syncing the // target branch with its parent. SyncConflict SyncStatus = iota // SyncNotInProgress indicates that there was no sync in progress when // SyncContinue was invoked. SyncNotInProgress SyncStatus = iota )
type SyncStrategy ¶
type SyncStrategy int
const ( // StrategyMergeCommit indicates that the sync should create a merge commit // from the parent branch onto the target branch. StrategyMergeCommit SyncStrategy = iota // StrategyRebase indicates that the sync should perform a rebase onto the // parent branch. StrategyRebase SyncStrategy = iota )
Click to show internal directories.
Click to hide internal directories.