Recognize Git repository environment variables
commiteb63bfc1b82ce21516b211df45069cbea87b7eee
authorRobin Rosenberg <robin.rosenberg@dewire.com>
Wed, 9 Dec 2009 08:54:08 +0000 (9 09:54 +0100)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 28 Dec 2009 23:58:47 +0000 (28 15:58 -0800)
treedc8e63302d0eadcedacb933bfda2d8ebc5b46d90
parent5b13adcea97c19750ebfd5be226c48bb646708cf
Recognize Git repository environment variables

This makes the jgit command line behave like the C Git implementation
in the respect.

These variables are not recognized in the core, though we add support
to do the overrides there. Hence other users of the JGit library, like
the Eclipse plugin and others, will not be affected.

GIT_DIR
The location of the ".git" directory.

GIT_WORK_TREE
The location of the work tree.

GIT_INDEX_FILE
The location of the index file.

GIT_CEILING_DIRECTORIES
A colon (semicolon on Windows) separated list of paths that
which JGit will not cross when looking for the .git directory.

GIT_OBJECT_DIRECTORY
The location of the objects directory under which objects are
stored.

GIT_ALTERNATE_OBJECT_DIRECTORIES
A colon (semicolon on Windows) separated list of object directories
to search for objects.

In addition to these we support the core.worktree config setting when
the git directory is set deliberately instead of being found.

Change-Id: I2b9bceb13c0f66b25e9e3cefd2e01534a286e04c
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/GitIndex.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java