diff options
Diffstat (limited to 'org.eclipse.jgit/src/org')
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; } /** |