diff options
author | Paulo Gomes <pjbgf@linux.com> | 2024-03-12 07:46:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-12 07:46:57 +0000 |
commit | e6c3e58198d176c497bb2dba1a2adb9302597676 (patch) | |
tree | ce3f6ddf6f98715bf84c883482783ef4fc974add /options.go | |
parent | f4f1a876e622c45ed51d05df1298d421a6868fcc (diff) | |
parent | 3ee5bc9dd308a5503d60cc26d17d7f10df28c37a (diff) | |
download | go-git-e6c3e58198d176c497bb2dba1a2adb9302597676.tar.gz |
Merge pull request #1044 from pjbgf/ff-merge
git: Implement Merge function with initial `FastForwardMerge` support
Diffstat (limited to 'options.go')
-rw-r--r-- | options.go | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -89,6 +89,25 @@ type CloneOptions struct { Shared bool } +// MergeOptions describes how a merge should be performed. +type MergeOptions struct { + // Strategy defines the merge strategy to be used. + Strategy MergeStrategy +} + +// MergeStrategy represents the different types of merge strategies. +type MergeStrategy int8 + +const ( + // FastForwardMerge represents a Git merge strategy where the current + // branch can be simply updated to point to the HEAD of the branch being + // merged. This is only possible if the history of the branch being merged + // is a linear descendant of the current branch, with no conflicting commits. + // + // This is the default option. + FastForwardMerge MergeStrategy = iota +) + // Validate validates the fields and sets the default values. func (o *CloneOptions) Validate() error { if o.URL == "" { |