diff options
author | Ned Twigg <ned.twigg@diffplug.com> | 2014-06-27 20:22:03 -0700 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2016-04-11 22:55:16 +0200 |
commit | 32a5993227b5f43cb32becdf14d3efb6e88fa847 (patch) | |
tree | 93608f2cd3d4acd0d1214a2d5b95102e78da65dd /org.eclipse.jgit/src/org/eclipse/jgit/errors/CheckoutConflictException.java | |
parent | eeeca8042f39c2a46ae0acc1cce4a206b9b2d560 (diff) | |
download | jgit-32a5993227b5f43cb32becdf14d3efb6e88fa847.tar.gz jgit-32a5993227b5f43cb32becdf14d3efb6e88fa847.zip |
Expose conflicting files in CheckoutConflictException
Change-Id: I5b3b7b0633354d5ccf0c6c320c0df9c93fdf8eeb
Signed-off-by: Ned Twigg <ned.twigg@diffplug.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/errors/CheckoutConflictException.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/errors/CheckoutConflictException.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/CheckoutConflictException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/CheckoutConflictException.java index db29f3f15b..b6010b6983 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/CheckoutConflictException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/CheckoutConflictException.java @@ -56,6 +56,8 @@ import org.eclipse.jgit.internal.JGitText; public class CheckoutConflictException extends IOException { private static final long serialVersionUID = 1L; + private final String[] conflicting; + /** * Construct a CheckoutConflictException for the specified file * @@ -63,6 +65,7 @@ public class CheckoutConflictException extends IOException { */ public CheckoutConflictException(String file) { super(MessageFormat.format(JGitText.get().checkoutConflictWithFile, file)); + conflicting = new String[] { file }; } /** @@ -72,6 +75,16 @@ public class CheckoutConflictException extends IOException { */ public CheckoutConflictException(String[] files) { super(MessageFormat.format(JGitText.get().checkoutConflictWithFiles, buildList(files))); + conflicting = files; + } + + /** + * @return the relative paths of the conflicting files (relative to the + * working directory root). + * @since 4.4 + */ + public String[] getConflictingFiles() { + return conflicting; } private static String buildList(String[] files) { |