aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RenameCallback.java
blob: 9856f2c252f0b6fabab43f4e4ba9d81fa5dd64b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * Copyright (C) 2011, GEBIT Solutions and others
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0 which is available at
 * https://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */
package org.eclipse.jgit.revwalk;

import org.eclipse.jgit.diff.DiffEntry;

/**
 * An instance of this class can be used in conjunction with a
 * {@link org.eclipse.jgit.revwalk.FollowFilter}. Whenever a rename has been
 * detected during a revision walk, it will be reported here.
 *
 * @see FollowFilter#setRenameCallback(RenameCallback)
 */
public abstract class RenameCallback {
	/**
	 * Called whenever a diff was found that is actually a rename or copy of a
	 * file.
	 *
	 * <p>Subclass of this class have to override this to receive diffEntry for
	 * the rename.
	 *
	 * @param entry
	 *            the entry representing the rename/copy
	 */
	public abstract void renamed(DiffEntry entry);

	/**
	 * Called whenever a diff was found that is actually a rename or copy of a
	 * file along with the commit that caused it.
	 *
	 * <p>Subclass of this class have an option to override this if it wants to
	 * know what commit generated the diffEntry. Otherwise defaults to the
	 * {@link RenameCallback#renamed(DiffEntry)} function.
	 *
	 * @param entry
	 *            the entry representing the rename/copy
	 * @param commit
	 *            commit at which callback occurred
	 *
	 * @since 6.7
	 */
	public void renamed(DiffEntry entry, RevCommit commit) {
		renamed(entry);
	}
}