@Test(expected = NoSuchFileException.class) public void testInputStream3() throws IOException { final File parentFolder = createTempDirectory(); final File gitFolder = new File( parentFolder, "mytest.git" ); final Git origin = JGitUtil.newRepository( gitFolder, true ); commit( origin, "master", "user", "user@example.com", "commit message", null, null, false, new HashMap<String, File>() {{ put( "path/to/file/myfile.txt", tempFile( "temp\n.origin\n.content" ) ); }} ); final URI newRepo = URI.create( "git://xxinputstream-test-repo" ); final Map<String, Object> env = new HashMap<String, Object>() {{ put( JGitFileSystemProvider.GIT_DEFAULT_REMOTE_NAME, origin.getRepository().getDirectory().toString() ); }}; final FileSystem fs = PROVIDER.newFileSystem( newRepo, env ); assertThat( fs ).isNotNull(); final Path path = PROVIDER.getPath( URI.create( "git://origin/master@xxinputstream-test-repo/path/to" ) ); PROVIDER.newInputStream( path ); }