merge

package
v0.0.0-...-4c964c4 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommitCount

func CommitCount(
	ctx context.Context,
	repoPath string,
	start, end string,
) (int, error)

CommitCount returns number of commits between the two git revisions.

func FastForward

func FastForward(
	ctx context.Context,
	refUpdater *hook.RefUpdater,
	repoPath, tmpDir string,
	_, _ *api.Signature,
	_ string,
	mergeBaseSHA, targetSHA, sourceSHA sha.SHA,
) (mergeSHA sha.SHA, conflicts []string, err error)

FastForward points the is internal implementation of merge used for Merge and Squash methods.

func FindConflicts

func FindConflicts(
	ctx context.Context,
	repoPath,
	base, head string,
) (mergeable bool, treeSHA string, conflicts []string, err error)

FindConflicts checks if two git revisions are mergeable and returns list of conflict files if they are not.

func Merge

func Merge(
	ctx context.Context,
	refUpdater *hook.RefUpdater,
	repoPath, tmpDir string,
	author, committer *api.Signature,
	message string,
	mergeBaseSHA, targetSHA, sourceSHA sha.SHA,
) (mergeSHA sha.SHA, conflicts []string, err error)

Merge merges two the commits (targetSHA and sourceSHA) using the Merge method.

func Rebase

func Rebase(
	ctx context.Context,
	refUpdater *hook.RefUpdater,
	repoPath, tmpDir string,
	_, committer *api.Signature,
	_ string,
	mergeBaseSHA, targetSHA, sourceSHA sha.SHA,
) (mergeSHA sha.SHA, conflicts []string, err error)

Rebase merges two the commits (targetSHA and sourceSHA) using the Rebase method.

func Squash

func Squash(
	ctx context.Context,
	refUpdater *hook.RefUpdater,
	repoPath, tmpDir string,
	author, committer *api.Signature,
	message string,
	mergeBaseSHA, targetSHA, sourceSHA sha.SHA,
) (mergeSHA sha.SHA, conflicts []string, err error)

Squash merges two the commits (targetSHA and sourceSHA) using the Squash method.

Types

type Func

type Func func(
	ctx context.Context,
	refUpdater *hook.RefUpdater,
	repoPath, tmpDir string,
	author, committer *api.Signature,
	message string,
	mergeBaseSHA, targetSHA, sourceSHA sha.SHA,
) (mergeSHA sha.SHA, conflicts []string, err error)

Func represents a merge method function. The concrete merge implementation functions must have this signature.

Jump to

Keyboard shortcuts

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