From 819c5bcc8b2a2685c20e5b8e568f776b19f7db63 Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Thu, 7 Mar 2024 22:42:27 +0100 Subject: [diffmergetool] Fix running command on Cygwin Because FS_Win32_Cygwin is a subclass of FS_Win32 the "instanceof" test for Cygwin must come first. Bug: jgit-34 Change-Id: If0cc0fa77e7aa0ce680289cecf808bc8859911a1 Signed-off-by: Thomas Wolf --- .../org/eclipse/jgit/internal/diffmergetool/CommandExecutor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'org.eclipse.jgit') diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/diffmergetool/CommandExecutor.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/diffmergetool/CommandExecutor.java index 25b7b8e5ba..c64a844af1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/diffmergetool/CommandExecutor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/diffmergetool/CommandExecutor.java @@ -165,6 +165,9 @@ public class CommandExecutor { if (fs instanceof FS_POSIX) { commandArray = new String[1]; commandArray[0] = commandFile.getCanonicalPath(); + } else if (fs instanceof FS_Win32_Cygwin) { + commandArray = new String[1]; + commandArray[0] = commandFile.getCanonicalPath().replace("\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$ } else if (fs instanceof FS_Win32) { if (useMsys2) { commandArray = new String[3]; @@ -176,9 +179,6 @@ public class CommandExecutor { commandArray = new String[1]; commandArray[0] = commandFile.getCanonicalPath(); } - } else if (fs instanceof FS_Win32_Cygwin) { - commandArray = new String[1]; - commandArray[0] = commandFile.getCanonicalPath().replace("\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$ } else { throw new ToolException( "JGit: file system not supported: " + fs.toString()); //$NON-NLS-1$ -- cgit v1.2.3