2 * Copyright (C) 2007 David Watson <dwatson@mimvista.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License, version 2.1, as published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
18 package org
.spearce
.jgit
.lib
;
21 import java
.io
.IOException
;
23 import org
.spearce
.jgit
.lib
.GitIndex
.Entry
;
26 * Visitor interface for traversing the index and two trees in parallel.
28 * When merging we deal with up to two tree nodes and a base node. Then
29 * we figure out what to do.
31 * A File argument is supplied to allow us to check for modifications in
32 * a work tree or update the file.
34 public interface IndexTreeVisitor
{
36 * Visit a blob, and corresponding tree and index entries.
43 public void visitEntry(TreeEntry treeEntry
, Entry indexEntry
, File file
) throws IOException
;
46 * Visit a blob, and corresponding tree nodes and associated index entry.
54 public void visitEntry(TreeEntry treeEntry
, TreeEntry auxEntry
, Entry indexEntry
, File file
) throws IOException
;
57 * Invoked after handling all child nodes of a tree, during a three way merge
64 public void finishVisitTree(Tree tree
, Tree auxTree
, String curDir
) throws IOException
;
67 * Invoked after handling all child nodes of a tree, during two way merge.
74 public void finishVisitTree(Tree tree
, int i
, String curDir
) throws IOException
;