diff options
author | Stefan Lay | 2010-12-14 12:22:54 +0000 |
---|---|---|
committer | Mathias Kinzler | 2010-12-14 12:22:54 +0000 |
commit | 35b7b6520355106dd62f2f241e71843a56b62503 (patch) | |
tree | 4e0d1d19c22deb1fa1d8acf20fb31bd3429e70e5 /org.eclipse.egit.core.test/src | |
parent | 536566d1cac672f70da9ed7c3b97893629dae2aa (diff) | |
download | egit-35b7b6520355106dd62f2f241e71843a56b62503.tar.gz egit-35b7b6520355106dd62f2f241e71843a56b62503.tar.xz egit-35b7b6520355106dd62f2f241e71843a56b62503.zip |
Fix cloning a repository with detached HEAD
The clone wizard could not handle remote repositories where the HEAD
is no branch. The SourceBranchPage threw an exception in the
LabelProvider. When the user selected "HEAD" on the
CloneDestinationPage the cloned repository was inconsistent.
Furthermore it is now possible to use the CloneOperation with
arbitrary Refs, not only with refs/heads/*.
Bug: 326693
Change-Id: Ibd999956bbecee148dbfd4ceb997741c09e3f87e
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.core.test/src')
-rw-r--r-- | org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/ListRemoteOperationTest.java | 4 | ||||
-rw-r--r-- | org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java | 4 |
2 files changed, 6 insertions, 2 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 c890c4e750..67a6f03bb9 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,6 +29,7 @@ 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.storage.file.FileRepository; import org.eclipse.jgit.transport.URIish; @@ -91,8 +92,9 @@ 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, - "refs/heads/master", "origin", 0); + master, "origin", 0); clop.run(null); repository2 = new TestRepository(new FileRepository(new File(workdir2, 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 035b744ba0..4cd916a415 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,6 +37,7 @@ 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.storage.file.FileRepository; import org.eclipse.jgit.transport.RemoteRefUpdate; @@ -101,8 +102,9 @@ 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, - "refs/heads/master", "origin", 0); + master, "origin", 0); clop.run(null); repository2 = new TestRepository(new FileRepository(new File(workdir2, |