Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] JGit 3.5.0 fails to create bare repo on Windows

Hi,

Matthias and I found out why the InitCommandTest was not detecting this bug when run from a maven build on Java7. The maven build adds the org.eclipse.jgit.java7 bundle to the classpath and therefore it is using the FS_Win32_Java7 class. This class can hide files using java7 (doesn’t matter whether they start with . or not)

		Path nioPath = path.toPath();
		Files.setAttribute(nioPath, "dos:hidden", Boolean.valueOf(hidden), //$NON-NLS-1$
				LinkOption.NOFOLLOW_LINKS);

But when we run tests in an environment without the java7 bundle we are using the FS class which throws an IllegalArgumentException when the filename doesn’t start with ‘.’ This is the case when you run a single test from inside eclipse. Then the java7 bundle is not added to the classpath and we are using the FS class.

Ciao
  Chris

Back to the top