summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-06-25 17:53:03 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-06-25 18:03:41 -0700
commit203bd6626767015dfb04d421c572b26a34e9cecf (patch)
treedb5083395717a5d3736298f6accfbec627c2c985 /org.eclipse.jgit/src/org/eclipse
parent532421d98925f23ddaa63c8d5f22be24879a6385 (diff)
downloadjgit-203bd6626767015dfb04d421c572b26a34e9cecf.tar.gz
jgit-203bd6626767015dfb04d421c572b26a34e9cecf.zip
Rename Repository getWorkDir to getWorkTree
This better matches with the name used in the environment (GIT_WORK_TREE), in the configuration file (core.worktree), and in our builder object. Since we are already breaking a good chunk of other code related to repository access, and this fairly easy to fix in an application's code base, I'm not going to offer the wrapper getWorkDir() method. Change-Id: Ib698ba4bbc213c48114f342378cecfe377e37bb7 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java17
3 files changed, 11 insertions, 10 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
index 00a0309152..76a3bc4794 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
@@ -163,7 +163,7 @@ public class MergeCommand extends GitCommand<MergeResult> {
RevCommit newHeadCommit) throws IOException, CheckoutConflictException {
GitIndex index = repo.getIndex();
- File workDir = repo.getWorkDir();
+ File workDir = repo.getWorkTree();
if (workDir != null) {
WorkDirCheckout workDirCheckout = new WorkDirCheckout(repo,
workDir, headCommit.asCommit(revWalk).getTree(), index,
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
index d655a97eb9..2e491af5a7 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
@@ -89,7 +89,7 @@ public class IndexDiff {
* @throws IOException
*/
public boolean diff() throws IOException {
- final File root = index.getRepository().getWorkDir();
+ final File root = index.getRepository().getWorkTree();
new IndexTreeWalker(index, tree, root, new AbstractIndexTreeVisitor() {
public void visitEntry(TreeEntry treeEntry, Entry indexEntry, File file) {
if (treeEntry == null) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
index 939d923a74..7b32d69a0e 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
@@ -96,7 +96,7 @@ public abstract class Repository {
static private final List<RepositoryListener> allListeners = new Vector<RepositoryListener>(); // thread safe
/** If not bare, the top level directory of the working files. */
- private final File workDir;
+ private final File workTree;
/** If not bare, the index file caching the working file states. */
private final File indexFile;
@@ -110,7 +110,7 @@ public abstract class Repository {
protected Repository(final BaseRepositoryBuilder options) {
gitDir = options.getGitDir();
fs = options.getFS();
- workDir = options.getWorkTree();
+ workTree = options.getWorkTree();
indexFile = options.getIndexFile();
}
@@ -886,7 +886,7 @@ public abstract class Repository {
return RepositoryState.BARE;
// Pre Git-1.6 logic
- if (new File(getWorkDir(), ".dotest").exists())
+ if (new File(getWorkTree(), ".dotest").exists())
return RepositoryState.REBASING;
if (new File(getDirectory(), ".dotest-merge").exists())
return RepositoryState.REBASING_INTERACTIVE;
@@ -1011,19 +1011,20 @@ public abstract class Repository {
* @return the "bare"-ness of this Repository
*/
public boolean isBare() {
- return workDir == null;
+ return workTree == null;
}
/**
- * @return the workdir file, i.e. where the files are checked out
+ * @return the root directory of the working tree, where files are checked
+ * out for viewing and editing.
* @throws IllegalStateException
- * if the repository is "bare"
+ * if the repository is bare and has no working directory.
*/
- public File getWorkDir() throws IllegalStateException {
+ public File getWorkTree() throws IllegalStateException {
if (isBare())
throw new IllegalStateException(
JGitText.get().bareRepositoryNoWorkdirAndIndex);
- return workDir;
+ return workTree;
}
/**