MCPcopy Create free account
hub / github.com/libgit2/pygit2 / _merge_options

Method _merge_options

pygit2/repository.py:786–809  ·  view source on GitHub ↗

Return a 'git_merge_opts *

(
        favor: int | MergeFavor, flags: int | MergeFlag, file_flags: int | MergeFileFlag
    )

Source from the content-addressed store, hash-verified

784 #
785 @staticmethod
786 def _merge_options(
787 favor: int | MergeFavor, flags: int | MergeFlag, file_flags: int | MergeFileFlag
788 ) -> 'GitMergeOptionsC':
789 """Return a 'git_merge_opts *'"""
790
791 # Check arguments type
792 if not isinstance(favor, (int, MergeFavor)):
793 raise TypeError('favor argument must be MergeFavor')
794
795 if not isinstance(flags, (int, MergeFlag)):
796 raise TypeError('flags argument must be MergeFlag')
797
798 if not isinstance(file_flags, (int, MergeFileFlag)):
799 raise TypeError('file_flags argument must be MergeFileFlag')
800
801 opts = ffi.new('git_merge_options *')
802 err = C.git_merge_options_init(opts, C.GIT_MERGE_OPTIONS_VERSION)
803 check_error(err)
804
805 opts.file_favor = int(favor)
806 opts.flags = int(flags)
807 opts.file_flags = int(file_flags)
808
809 return opts
810
811 def merge_file_from_index(
812 self,

Callers 4

merge_commitsMethod · 0.95
merge_treesMethod · 0.95
mergeMethod · 0.95
test_merge_optionsFunction · 0.80

Calls 1

check_errorFunction · 0.85

Tested by 1

test_merge_optionsFunction · 0.64