jgit/org.eclipse.jgit
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 Silence API errors introduced by 093fbbd1 2020-03-05 13:53:10 +01:00
META-INF Prepare 5.6.2-SNAPSHOT builds 2020-02-14 00:15:39 +01:00
findBugs
resources/org/eclipse/jgit Merge branch 'stable-5.5' into stable-5.6 2020-02-01 02:06:47 +01:00
src/org/eclipse/jgit FS.runInShell(): handle quoted filters and hooksPath containing blanks 2020-04-03 08:18:39 +02:00
.classpath
.fbprefs
.gitignore
.project
BUILD Merge branch 'stable-5.4' into stable-5.5 2019-09-08 17:35:14 +02:00
about.html SHA-1: collision detection support 2017-02-28 16:38:43 -08:00
build.properties
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