| Modifier and Type | Class and Description |
|---|---|
| public static enum | ResolveMerger.
If the merge fails (means: not stopped because of unresolved conflicts) this enum is used to explain why it failed |
| protected static class | ResolveMerger.
Handles work tree updates on both the checkout and the index. |
| Modifier and Type | Field and Description |
|---|---|
| protected AttributesNodeProvider | attributesNodeProvider
The |
| protected String[] | commitNames
string versions of a list of commit SHA1s |
| private ContentMergeStrategy | contentStrategy
The |
| protected DirCache | dircache
Directory cache |
| protected boolean | enterSubtree
Updated as we merge entries of the tree walk. |
| protected Map | failingPaths
Paths for which the merge failed altogether. |
| protected boolean | inCore
Set to true if this merge should work in-memory. |
| protected MergeAlgorithm | mergeAlgorithm
our merge algorithm |
| protected Map | mergeResults
Low-level textual merge results. |
| protected List | modifiedFiles
Files modified during this operation. |
| private static final Attributes | |
| protected ObjectId | resultTree
merge result as tree |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected NameConflictTreeWalk | tw
The tree walk which we'll iterate over to merge entries. |
| protected List | unmergedPaths
Paths that could not be merged by this merger because of an unsolvable conflict. |
| protected WorkingTreeIterator | workingTreeIterator
The iterator to access the working tree. |
| protected ResolveMerger. | workTreeUpdater
Handler for repository I/O actions. |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | |
| protected | ResolveMerger(ObjectInserter
an inserter, Config org. object.the repository configuration config)Constructor for ResolveMerger. |
| Modifier and Type | Method and Description |
|---|---|
| private DirCacheEntry | Returns: the entry which was added to the indexthe new path path, CanonicalTreeParser canonical tree parser p, int the stage stage, Instant lastModified attribute of the file lastModified, long file length len)adds a new path with the specified stage to the index builder |
| private DirCacheEntry | addConflict(CanonicalTreeParser
of the conflict base, CanonicalTreeParser of the conflict ours, CanonicalTreeParser of the conflict theirs)Adds the conflict stages for the current path of |
| protected void | addDeletion(String
of the entry path, boolean whether it is a file isFile, Attributes to use for determining the attributes)CheckoutMetadataRemember a path for deletion, and remember its |
| protected void | addToCheckout(String
of the entry path, DirCacheEntry to add entry, Attributes[] the attributes)Attributes of the treesAdds a |
| private MergeResult | Returns: the result of the content mergeused to parse base tree base, CanonicalTreeParser used to parse ours tree ours, CanonicalTreeParser used to parse theirs tree theirs, Attributes[] attributes for the different stages attributes, ContentMergeStrategy merge strategy strategy)Does the content merge. |
| private static MergeResult | createGitLinksMergeResult(CanonicalTreeParser base, CanonicalTreeParser ours, CanonicalTreeParser theirs)
|
| private static String[] | |
| private TemporaryBuffer | |
| public boolean | Returns: true if a failure occurred, false
otherwiseReturns whether this merge failed (i.e. not stopped because of a conflict) |
| private ContentMergeStrategy | |
| public String[] | Returns: the names of the commits as they would appear in conflict markers.Get the names of the commits as they would appear in conflict markers. |
| public ContentMergeStrategy | Returns: theContentMergeStrategy in effectRetrieves the content merge strategy for content conflicts. |
| public Map | Returns: lists paths causing this merge to fail (not stopped because of a conflict).null is returned if this merge didn't
fail.Get list of paths causing this merge to fail (not stopped because of a conflict). |
| private static MergeAlgorithm | |
| public Map | |
| public List | Returns: the paths of files which have been modified by this merge. A file will be modified if a content-merge works on this path or if the merge algorithm decides to take the theirs-version. This is a superset of the files listed bygetUnmergedPaths().Get the paths of files which have been modified by this merge. |
| private RawText | |
| public ObjectId | getResultTreeId()
Implements abstract org. Get resulting tree. |
| public Map | Returns: a map which maps the paths of files which have to be checked out because the merge created new fully-merged content for this file into the index. This means: the merge wrote a new stage 0 entry for this path.Get a map which maps the paths of files which have to be checked out because the merge created new fully-merged content for this file into the index. |
| public List | Returns: the paths with conflicts. This is a subset of the files listed bygetModifiedFiles()Get the paths with conflicts. |
| private static boolean | |
| private boolean | |
| private boolean | |
| private DirCacheEntry | Returns: the entry which was added to the indexthe entry which should be copied e)adds a entry to the index builder which is a copy of the specified DirCacheEntry |
| private int | Returns: the merged filemode orFileMode#MISSING in case of a
conflictfilemode found in BASE modeB, int filemode found in OURS modeO, int filemode found in THEIRS modeT)Try to merge filemodes. |
| protected boolean | |
| protected boolean | Returns: whether the trees merged cleanlya headTree, RevTree org. object.a mergeTree, boolean org. object.Controls what to do in case a content-merge is done and a
conflict is detected. The default setting for this should be
ignoreConflicts)false. In this case the working tree file is
filled with new content (containing conflict markers) and the
index is filled with multiple stages containing BASE, OURS and
THEIRS content. Having such non-0 stages is the sign to git
tools that there are still conflicts for that path.
If The resolve conflict way of three way merging |
| protected boolean | Returns: Whether the trees merged cleanly.The walk to iterate over. treeWalk, boolean ignoreConflicts)Process the given TreeWalk's entries. |
| private static boolean | |
| protected boolean | Returns: false if the merge will fail because the index entry
didn't match ours or the working-dir file was dirty and a
conflict occurredthe common base for ours and theirs base, CanonicalTreeParser the ours side of the merge. When merging a branch into the
HEAD ours will point to HEAD ours, CanonicalTreeParser the theirs side of the merge. When merging a branch into the
current HEAD theirs will point to the branch which is merged
into HEAD. theirs, DirCacheBuildIterator the index entry index, WorkingTreeIterator the file in the working tree work, boolean ignoreConflicts, Attributes[] the attributes)Attributes for the three treesProcesses one path and tries to merge taking git attributes in account. |
| public void | setAttributesNodeProvider(AttributesNodeProvider
the attributeNodeProvider to set attributesNodeProvider)Sets the |
| public void | setCommitNames(String[]
the names of the commits as they would appear in conflict
markers commitNames)Set the names of the commits as they would appear in conflict markers |
| public void | setContentMergeStrategy(ContentMergeStrategy
ContentMergeStrategy to useSets the content merge strategy for content conflicts. |
| public void | |
| public void | setWorkingTreeIterator(WorkingTreeIterator
the workingTreeIt to set workingTreeIterator)Sets the WorkingTreeIterator to be used by this merger. |
| private void | updateIndex(CanonicalTreeParser
used to parse base tree base, CanonicalTreeParser used to parse ours tree ours, CanonicalTreeParser used to parse theirs tree theirs, MergeResult<RawText> merge result result, Attributes the file's attributes attributes)Updates the index after a content merge has happened. |
| private File | Returns: the working tree file to which the merged content was written.the raw merged content rawMerged, Attributes the files .gitattributes entries attributes)Writes merged file content to the working tree. |