KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGIT_TRIVIAL_MERGE_BASE< DERIVED > Class Template Reference

CRTP base for libgit2 merge drivers that resolve only the trivial 3-way cases inline and defer real conflicts to the mergetool. More...

#include <kigit_trivial_merge_base.h>

Public Member Functions

 KIGIT_TRIVIAL_MERGE_BASE (git_merge_driver_source *aSource, git_buf *aBuf)
 
int Merge ()
 

Static Public Member Functions

static int Apply (const git_merge_driver_source *aSrc, const char **aPathOut, unsigned int *aModeOut, git_buf *aMergedOut)
 

Private Attributes

git_merge_driver_source * m_mergeDriver
 
git_buf * m_result
 

Detailed Description

template<typename DERIVED>
class KIGIT_TRIVIAL_MERGE_BASE< DERIVED >

CRTP base for libgit2 merge drivers that resolve only the trivial 3-way cases inline and defer real conflicts to the mergetool.

Each DERIVED instantiation yields a distinct static Apply() entry point, so the three drivers register as separate libgit2 drivers from one shared Merge() body.

The non-trivial path writes the ours blob through so the working-tree file stays parseable while git records GIT_EMERGECONFLICT.

Definition at line 37 of file kigit_trivial_merge_base.h.

Constructor & Destructor Documentation

◆ KIGIT_TRIVIAL_MERGE_BASE()

template<typename DERIVED>
KIGIT_TRIVIAL_MERGE_BASE< DERIVED >::KIGIT_TRIVIAL_MERGE_BASE ( git_merge_driver_source * aSource,
git_buf * aBuf )
inline

Definition at line 40 of file kigit_trivial_merge_base.h.

References m_mergeDriver, and m_result.

Member Function Documentation

◆ Apply()

template<typename DERIVED>
static int KIGIT_TRIVIAL_MERGE_BASE< DERIVED >::Apply ( const git_merge_driver_source * aSrc,
const char ** aPathOut,
unsigned int * aModeOut,
git_buf * aMergedOut )
inlinestatic

Definition at line 63 of file kigit_trivial_merge_base.h.

References KIGIT::ApplyMergeDriver().

◆ Merge()

template<typename DERIVED>
int KIGIT_TRIVIAL_MERGE_BASE< DERIVED >::Merge ( )
inline

Member Data Documentation

◆ m_mergeDriver

template<typename DERIVED>
git_merge_driver_source* KIGIT_TRIVIAL_MERGE_BASE< DERIVED >::m_mergeDriver
private

Definition at line 70 of file kigit_trivial_merge_base.h.

Referenced by KIGIT_TRIVIAL_MERGE_BASE(), and Merge().

◆ m_result

template<typename DERIVED>
git_buf* KIGIT_TRIVIAL_MERGE_BASE< DERIVED >::m_result
private

Definition at line 71 of file kigit_trivial_merge_base.h.

Referenced by KIGIT_TRIVIAL_MERGE_BASE(), and Merge().


The documentation for this class was generated from the following file: