jgit/org.eclipse.jgit.test
Thomas Wolf 2640d38f14 FS.runInShell(): handle quoted filters and hooksPath containing blanks
Revert commit 2323d7a. Using $0 in the shell command call results in
the command string being taken literally. That was introduced to fix
a problem with backslashes, but is actually not correct.

First, the problem with backslashes occurred only on Win32/Cygwin,
and has been properly fixed in commit 6f268f8.

Second, this is used only for hooks (which don't have backslashes in
their names) and filter commands from the git config, where the user
is responsible for properly quoting or escaping such that the commands
work.

Third, using $0 actually breaks correctly quoted filter commands
like in the bug report. The shell really takes the command literally,
and then doesn't find the command because of quotes.

So revert this change.

At the same time there's a related problem with hooks. If the path to
the hook contains blanks, runInShell() would also fail to find the
hook. In this case, the command doesn't come from user input but is
just a Java File object with an absolute path containing blanks. (Can
occur if core.hooksPath points to such a path with blanks, or if the
repository has such a path.)

The path to the hook as obtained from the file system must be quoted.

Add a test for a hook path with a blank.

This reverts commit 2323d7a1ef.

Bug: 561666
Change-Id: I4d7df13e6c9b245fe1706e191e4316685a8a9d59
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2020-04-03 08:18:39 +02:00
..
.settings Enable and fix "Statement unnecessarily nested within else clause" warnings 2019-10-17 10:20:14 +09:00
META-INF Prepare 5.6.2-SNAPSHOT builds 2020-02-14 00:15:39 +01:00
exttst/org/eclipse/jgit Reorder modifiers to follow Java Language Specification 2020-02-19 13:15:43 +09:00
resources/org/eclipse/jgit/transport/ssh Apache MINA sshd client: test reading encrypted ed25519 keys 2019-05-06 15:22:08 +02:00
src/org/eclipse/jgit WorkingTreeModifiedEvent: must be fired explicitly after merge 2019-11-03 10:10:16 +01:00
tst/org/eclipse/jgit FS.runInShell(): handle quoted filters and hooksPath containing blanks 2020-04-03 08:18:39 +02:00
tst-rsrc Merge branch 'stable-5.4' 2019-08-20 00:16:11 +02:00
.classpath Apache MINA sshd client 2018-11-13 10:49:26 -08:00
.gitignore Fix test setup for Eclipse Photon and greater 2018-11-02 18:50:26 +01:00
.project Remove references to org.eclipse.jgit.java7 2016-08-05 11:22:27 +09:00
BUILD RequestValidatorTestCase: Tests for the request validators 2019-09-18 13:54:50 -07:00
build.properties Apache MINA sshd client 2018-11-13 10:49:26 -08:00
org.eclipse.jgit.core--All-Tests (Java 8) (de).launch Fixed few locale dependent pgm tests 2016-01-02 17:41:58 +01:00
org.eclipse.jgit.core--All-Tests (Java 8).launch Fix classpath of test launch configurations 2015-11-21 00:33:43 +01:00
org.eclipse.jgit.core--All-Tests.launch Use JUnit4 for tests 2010-08-26 12:26:38 -05:00
org.eclipse.jgit.test-WalkEncryptionTest-Proxy.launch Adding AES Walk Encryption support in http://www.jets3t.org/ mode 2015-10-18 19:14:31 +00:00
org.eclipse.jgit.test-WalkEncryptionTest.launch Adding AES Walk Encryption support in http://www.jets3t.org/ mode 2015-10-18 19:14:31 +00:00
plugin.properties Fix bundle localization of Apache SSH bundle 2019-06-21 17:54:06 +02:00
pom.xml Prepare 5.6.2-SNAPSHOT builds 2020-02-14 00:15:39 +01:00
tests.bzl Merge branch 'stable-5.3' into stable-5.4 2019-08-08 13:24:14 +02:00