Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Rosenberg2010-01-14 23:36:23 +0000
committerShawn O. Pearce2010-01-23 19:52:54 +0000
commite339c5ca946a4a879de507476c49d36e804459ec (patch)
treecc23a0753906ee46299ee886bb405eaf7442dc60 /org.eclipse.egit.core.test
parent112d70ce450e8f6151f921b102f9b1a41e4ea280 (diff)
downloadegit-e339c5ca946a4a879de507476c49d36e804459ec.tar.gz
egit-e339c5ca946a4a879de507476c49d36e804459ec.tar.xz
egit-e339c5ca946a4a879de507476c49d36e804459ec.zip
Make use of the JGit constant DOT_GIT
This constant refers to the .git directory, not a suffix. Change-Id: Ieac94c9a07ed1313ea420c646c66b9384e03d80a Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.egit.core.test')
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/T0003_AdaptableFileTreeIteratorTest.java3
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/mapping/T0002_history.java5
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/op/T0001_ConnectProviderOperationTest.java11
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java4
4 files changed, 13 insertions, 10 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/T0003_AdaptableFileTreeIteratorTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/T0003_AdaptableFileTreeIteratorTest.java
index 8eface5b6..9a52f330d 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/T0003_AdaptableFileTreeIteratorTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/T0003_AdaptableFileTreeIteratorTest.java
@@ -19,6 +19,7 @@ import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.egit.core.op.ConnectProviderOperation;
import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.egit.core.test.GitTestCase;
+import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.treewalk.TreeWalk;
import org.eclipse.jgit.treewalk.WorkingTreeIterator;
@@ -45,7 +46,7 @@ public class T0003_AdaptableFileTreeIteratorTest extends GitTestCase {
fileWriter.close();
final ConnectProviderOperation operation = new ConnectProviderOperation(
- project.getProject(), new File("../.git"));
+ project.getProject(), new File("..", Constants.DOT_GIT));
operation.run(null);
}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/mapping/T0002_history.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/mapping/T0002_history.java
index feab40a54..e3855bd52 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/mapping/T0002_history.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/mapping/T0002_history.java
@@ -24,6 +24,7 @@ import org.eclipse.team.core.history.IFileHistory;
import org.eclipse.team.core.history.IFileHistoryProvider;
import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.jgit.lib.Commit;
+import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.FileTreeEntry;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectWriter;
@@ -53,7 +54,7 @@ public class T0002_history extends GitTestCase {
super.setUp();
project.createSourceFolder();
gitDir = new File(project.getProject().getWorkspace().getRoot()
- .getRawLocation().toFile(), ".git");
+ .getRawLocation().toFile(), Constants.DOT_GIT);
thisGit = new Repository(gitDir);
workDir = thisGit.getWorkDir();
thisGit.create();
@@ -101,7 +102,7 @@ public class T0002_history extends GitTestCase {
assertEquals(RefUpdate.Result.NEW, lck.forceUpdate());
ConnectProviderOperation operation = new ConnectProviderOperation(
- project.getProject(), new File("../.git"));
+ project.getProject(), new File("..", Constants.DOT_GIT));
operation.run(null);
}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/op/T0001_ConnectProviderOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/op/T0001_ConnectProviderOperationTest.java
index eac2aabf4..045c46626 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/op/T0001_ConnectProviderOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/op/T0001_ConnectProviderOperationTest.java
@@ -24,6 +24,7 @@ import org.eclipse.egit.core.op.ConnectProviderOperation;
import org.eclipse.egit.core.test.GitTestCase;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.jgit.lib.Commit;
+import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.FileTreeEntry;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectWriter;
@@ -37,7 +38,7 @@ public class T0001_ConnectProviderOperationTest extends GitTestCase {
public void testNoRepository() throws CoreException {
ConnectProviderOperation operation = new ConnectProviderOperation(
- project.getProject(), new File("../../.git"));
+ project.getProject(), new File("../..", Constants.DOT_GIT));
operation.run(null);
assertFalse(RepositoryProvider.isShared(project.getProject()));
@@ -47,12 +48,12 @@ public class T0001_ConnectProviderOperationTest extends GitTestCase {
public void testNewRepository() throws CoreException, IOException {
File gitDir = new File(project.getProject().getWorkspace().getRoot()
- .getRawLocation().toFile(), ".git");
+ .getRawLocation().toFile(), Constants.DOT_GIT);
Repository repository = new Repository(gitDir);
repository.create();
repository.close();
ConnectProviderOperation operation = new ConnectProviderOperation(
- project.getProject(), new File("../.git"));
+ project.getProject(), new File("..", Constants.DOT_GIT));
operation.run(null);
assertTrue(RepositoryProvider.isShared(project.getProject()));
@@ -69,7 +70,7 @@ public class T0001_ConnectProviderOperationTest extends GitTestCase {
fileA.create(new ByteArrayInputStream(srcA.getBytes()), false, null);
File gitDir = new File(project.getProject().getWorkspace().getRoot()
- .getRawLocation().toFile(), ".git");
+ .getRawLocation().toFile(), Constants.DOT_GIT);
Repository thisGit = new Repository(gitDir);
thisGit.create();
Tree rootTree = new Tree(thisGit);
@@ -94,7 +95,7 @@ public class T0001_ConnectProviderOperationTest extends GitTestCase {
assertEquals(RefUpdate.Result.NEW, lck.forceUpdate());
ConnectProviderOperation operation = new ConnectProviderOperation(
- project.getProject(), new File("../.git"));
+ project.getProject(), new File("..", Constants.DOT_GIT));
operation.run(null);
final boolean f[] = new boolean[1];
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java
index f876085cc..46c3b1ba5 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java
@@ -10,12 +10,12 @@ package org.eclipse.egit.core.test;
import java.io.File;
import java.io.IOException;
+import org.eclipse.jgit.lib.Constants;
import junit.framework.TestCase;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jgit.junit.MockSystemReader;
-import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.util.SystemReader;
public abstract class GitTestCase extends TestCase {
@@ -32,7 +32,7 @@ public abstract class GitTestCase extends TestCase {
.getAbsoluteFile().toString());
project = new TestProject(true);
gitDir = new File(project.getProject().getWorkspace().getRoot()
- .getRawLocation().toFile(), ".git");
+ .getRawLocation().toFile(), Constants.DOT_GIT);
rmrf(gitDir);
}

Back to the top