Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Stocker2011-03-23 17:21:48 +0000
committerChris Aniszczyk2011-03-30 21:58:45 +0000
commit9620b68017bcc006ad98fb90ae7dd42fead039b1 (patch)
tree086aff4131c15b34c9019fa4829efe9ccf71f654 /org.eclipse.egit.core.test/src/org/eclipse/egit
parentbc429b816589c950d4dcb9829b3d5d6f7ac7eeaf (diff)
downloadegit-9620b68017bcc006ad98fb90ae7dd42fead039b1.tar.gz
egit-9620b68017bcc006ad98fb90ae7dd42fead039b1.tar.xz
egit-9620b68017bcc006ad98fb90ae7dd42fead039b1.zip
Change ref parameter of CloneOperation to String
The parameter is used for specifying what branch should be checked out after fetch. Before this change, it was of type Ref. But a Ref is not really right here, as a Ref should point to a valid object id, and the ids aren't generally known before a clone. This lead users of CloneOperation to passing a Ref with only a name set, and no object id (using a anonymous Ref subclass or passing null as object id). Before the parameter was a Ref, it already was a String, but one could only specify a short branch name (e.g. "master"), not a full ref name ("refs/heads/master"). With this change, it's still the full ref name, just as a String. Bug: 338603 Change-Id: I420059e7eda4b3bbbf335557217bc89f11c27abd Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Diffstat (limited to 'org.eclipse.egit.core.test/src/org/eclipse/egit')
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/ListRemoteOperationTest.java4
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java4
2 files changed, 2 insertions, 6 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/ListRemoteOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/ListRemoteOperationTest.java
index f51587d426..a3b527dfdd 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/ListRemoteOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/ListRemoteOperationTest.java
@@ -29,7 +29,6 @@ import org.eclipse.egit.core.op.ListRemoteOperation;
import org.eclipse.egit.core.test.DualRepositoryTestCase;
import org.eclipse.egit.core.test.TestRepository;
import org.eclipse.jgit.lib.Constants;
-import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.RefUpdate;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.transport.URIish;
@@ -92,9 +91,8 @@ public class ListRemoteOperationTest extends DualRepositoryTestCase {
// let's clone repository1 to repository2
URIish uri = new URIish("file:///"
+ repository1.getRepository().getDirectory().toString());
- Ref master = repository1.getRepository().getRef("refs/heads/master");
CloneOperation clop = new CloneOperation(uri, true, null, workdir2,
- master, "origin", 0);
+ "refs/heads/master", "origin", 0);
clop.run(null);
Repository existingRepo = Activator
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java
index 1a2cf05b3e..b4b4300d15 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java
@@ -37,7 +37,6 @@ import org.eclipse.egit.core.test.DualRepositoryTestCase;
import org.eclipse.egit.core.test.TestRepository;
import org.eclipse.egit.core.test.TestUtils;
import org.eclipse.jgit.lib.Constants;
-import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.RefUpdate;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.transport.RemoteRefUpdate;
@@ -102,9 +101,8 @@ public class PushOperationTest extends DualRepositoryTestCase {
// let's clone repository1 to repository2
URIish uri = new URIish("file:///"
+ repository1.getRepository().getDirectory().toString());
- Ref master = repository1.getRepository().getRef("refs/heads/master");
CloneOperation clop = new CloneOperation(uri, true, null, workdir2,
- master, "origin", 0);
+ "refs/heads/master", "origin", 0);
clop.run(null);
Repository repo2 = Activator.getDefault().getRepositoryCache().lookupRepository(new File(workdir2,

Back to the top