threads / patch / 14938

patchAllow jgit to load additional user classes

Subject: [JGIT PATCH] Allow jgit to load additional user classes

## tl;dr

One message between Aug 11, 2008 and Aug 11, 2008. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Shawn O. Pearce· Aug 11, 2008, 19:54 UTC · lore

Users may want to develop their own custom programs (implementations of TextBuiltin) and add them into the jgit runtime for command line usage. We now load additional classes from $JGIT_CLASSPATH, if it was defined when the process started.

To avoid users replacing our own internal commands or classes we put the user classpath behind our own, ensuring all of our standard classes and resources are found first.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 jgit.sh |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
Show changes to jgit.sh +5 −0
diff --git a/jgit.sh b/jgit.sh
index 121beec..6b9b224 100755
--- a/jgit.sh
+++ b/jgit.sh
@@ -15,6 +15,11 @@ else
 	java_args=
 fi
 
+if [ -n "$JGIT_CLASSPATH" ]
+then
+	cp="$cp:$JGIT_CLASSPATH"
+fi
+
 # Cleanup paths for Cygwin.
 #
 case "`uname`" in
-- 
1.5.4.5

-- 
Shawn.

← back to recent threads