using System;
using System.Runtime.InteropServices;
namespace LibGit2Sharp.Core
{
[StructLayout(LayoutKind.Sequential)]
internal struct GitMergeOpts
{
public uint Version;
public GitMergeTreeFlags MergeTreeFlags;
///
/// Similarity to consider a file renamed.
///
public uint RenameThreshold;
///
/// Maximum similarity sources to examine (overrides
/// 'merge.renameLimit' config (default 200)
///
public uint TargetLimit;
///
/// Pluggable similarityMetric; pass IntPtr.Zero
/// to use internal metric.
///
public IntPtr SimilarityMetric;
///
/// Flags for automerging content.
///
public MergeFileFavor MergeFileFavorFlags;
}
///
/// The results of `git_merge_analysis` indicate the merge opportunities.
///
[Flags]
internal enum GitMergeAnalysis
{
///
/// No merge is possible. (Unused.)
///
GIT_MERGE_ANALYSIS_NONE = 0,
///
/// A "normal" merge; both HEAD and the given merge input have diverged
/// from their common ancestor. The divergent commits must be merged.
///
GIT_MERGE_ANALYSIS_NORMAL = (1 << 0),
///
/// All given merge inputs are reachable from HEAD, meaning the
/// repository is up-to-date and no merge needs to be performed.
///
GIT_MERGE_ANALYSIS_UP_TO_DATE = (1 << 1),
///
/// The given merge input is a fast-forward from HEAD and no merge
/// needs to be performed. Instead, the client can check out the
/// given merge input.
///
GIT_MERGE_ANALYSIS_FASTFORWARD = (1 << 2),
/**
* The HEAD of the current repository is "unborn" and does not point to
* a valid commit. No merge can be performed, but the caller may wish
* to simply set HEAD to the target commit(s).
*/
GIT_MERGE_ANALYSIS_UNBORN = (1 << 3),
}
internal enum GitMergePreference
{
///
/// No configuration was found that suggests a preferred behavior for
/// merge.
///
GIT_MERGE_PREFERENCE_NONE = 0,
///
/// There is a `merge.ff=false` configuration setting, suggesting that
/// the user does not want to allow a fast-forward merge.
///
GIT_MERGE_PREFERENCE_NO_FASTFORWARD = (1 << 0),
///
/// There is a `merge.ff=only` configuration setting, suggesting that
/// the user only wants fast-forward merges.
///
GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY = (1 << 1),
}
[Flags]
internal enum GitMergeTreeFlags
{
///
/// No options.
///
GIT_MERGE_TREE_NORMAL = 0,
///
/// GIT_MERGE_TREE_FIND_RENAMES in libgit2
///
GIT_MERGE_TREE_FIND_RENAMES = (1 << 0),
}
}