DiffToolTest: don't assume temp files use java.io.tmpdir

testToolCached compared the temp file path that "git difftool --staged"
creates against System.getProperty("java.io.tmpdir"). Inside the
Surefire fork those two name different directories. In order:

- the fork starts with -Djava.io.tmpdir=${project.build.directory}
  from the pgm.test pom, so java.io.tmpdir is <module>/target at startup
- File.createTempFile captures that startup value and writes under
  <module>/target
- Maven is run with -Djava.io.tmpdir=<dir> (as CI does), and Surefire
  applies it with System.setProperty after the fork has started
- System.getProperty therefore now returns <dir>, not <module>/target
- the test expects <dir>/<name>_REMOTE_* but the file is under
  <module>/target, so the match fails

This surfaced with the Java 17 -> 25 bump: on Java 17
File.createTempFile read java.io.tmpdir live and so agreed with
System.getProperty; since Java 21 it uses the value captured at JVM
startup, so the two diverge once Surefire changes the property after
the fork has started.

Neutralize this JDK behavioral change by making no assumption about
where the temporary directory comes from: match only the file name
pattern, not its directory, so the test harness is JDK-agnostic.

Change-Id: I9c48f8c449301230f5a3a71b4ca98c1be911c8d6
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/DiffToolTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/DiffToolTest.java
index f0908ce..732b703 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/DiffToolTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/DiffToolTest.java
@@ -282,17 +282,13 @@ private void configureEchoTool(String toolName) {
 	}
 
 	private Pattern[] getExpectedCachedToolOutputNoPrompt(String[] conflictingFilenames) {
-		String tmpDir = System.getProperty("java.io.tmpdir");
-		if (tmpDir.endsWith(File.separator)) {
-			tmpDir = tmpDir.substring(0, tmpDir.length() - 1);
-		}
 		Pattern emptyPattern = Pattern.compile("");
 		List<Pattern> expectedToolOutput = new ArrayList<>();
 		for (int i = 0; i < conflictingFilenames.length; ++i) {
 			String changedFilename = conflictingFilenames[i];
 			Path fullPath = getFullPath(changedFilename);
 			String filename = fullPath.getFileName().toString();
-			String regexp = tmpDir + File.separatorChar + filename
+			String regexp = ".*" + Pattern.quote(File.separator + filename)
 					+ "_REMOTE_.*";
 			Pattern pattern = Pattern.compile(regexp);
 			expectedToolOutput.add(pattern);