diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2011-02-04 05:51:27 -0800 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2011-02-05 17:40:54 -0800 |
commit | c6423932bf466af76daf2cf38f37bc23cd16bf63 (patch) | |
tree | 2e68a05b6c0059cff6d4dd1bef96be634e2adce0 /org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java | |
parent | 78e61ea2519f0877c76216b57cf9554639383e70 (diff) | |
download | jgit-c6423932bf466af76daf2cf38f37bc23cd16bf63.tar.gz jgit-c6423932bf466af76daf2cf38f37bc23cd16bf63.zip |
Fix JGit --upload-pack, --receive-pack options
JGit did not use sh -c to run the receive-pack or upload-pack programs
locally, which caused errors if these strings contained spaces and
needed the local shell to evaluate them.
Win32 support using cmd.exe /c is completely untested, but seems like
it should work based on the limited information I could get through
Google search results.
Bug: 336301
Change-Id: I22e5e3492fdebbae092d1ce6b47ad411e57cc1ba
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java index 87d5395bf9..8faefede1c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java @@ -255,4 +255,18 @@ public abstract class FS { /** @return the $prefix directory C Git would use. */ public abstract File gitPrefix(); + + /** + * Initialize a ProcesssBuilder to run a command using the system shell. + * + * @param cmd + * command to execute. This string should originate from the + * end-user, and thus is platform specific. + * @param args + * arguments to pass to command. These should be protected from + * shell evaluation. + * @return a partially completed process builder. Caller should finish + * populating directory, environment, and then start the process. + */ + public abstract ProcessBuilder runInShell(String cmd, String[] args); } |