{"thread":{"id":"17973","subject":"[EGIT] [PATCH v2 1/1] Make sure to set up the default remote branch correctly","startedAt":"2009-02-23T17:45:22Z","lastAt":"2009-02-23T17:45:23Z","messageCount":2,"participants":["Ferry Huberts"],"isPatch":true,"patchVersion":2,"patchTotal":1},"messages":[{"id":"105924","messageId":"cover.1235410609.git.ferry.huberts@pelagic.nl","threadId":"17973","inReplyTo":null,"subject":"[EGIT] [PATCH v2 0/1] Make sure to setup a clone the same as git-clone does","fromName":"Ferry Huberts","fromEmail":"ferry.huberts@pelagic.nl","sentAt":"2009-02-23T17:45:22Z","receivedAt":"2009-02-23T17:45:22Z","isPatch":true,"sender":{"key":"ferry.huberts@pelagic.nl","avatar":"https://gravatar.com/avatar/9f63c0289ad23cbdef0f7609a0af85ff0f4b3babfd066de9ff58f62d48cfd6f2?d=mp&s=160"},"body":"Currently the plugin does not setup the default remote branch, something that\ngit-clone does do.\n\nThis patch fixes the issue and makes the plugin setup a cloned repository\nexactly the same as git-clone.\n\nFerry Huberts (1):\n  Make sure to set up the default remote branch correctly\n\n .../org/spearce/egit/core/op/CloneOperation.java   |   18 ++++++++++++++++++\n 1 files changed, 18 insertions(+), 0 deletions(-)\n"},{"id":"105923","messageId":"885442b0ed51a782b743aaef32e259ccd24429f4.1235410609.git.ferry.huberts@pelagic.nl","threadId":"17973","inReplyTo":"cover.1235410609.git.ferry.huberts@pelagic.nl","subject":"[EGIT] [PATCH v2 1/1] Make sure to set up the default remote branch correctly","fromName":"Ferry Huberts","fromEmail":"ferry.huberts@pelagic.nl","sentAt":"2009-02-23T17:45:23Z","receivedAt":"2009-02-23T17:45:23Z","isPatch":true,"sender":{"key":"ferry.huberts@pelagic.nl","avatar":"https://gravatar.com/avatar/9f63c0289ad23cbdef0f7609a0af85ff0f4b3babfd066de9ff58f62d48cfd6f2?d=mp&s=160"},"body":"This is to make sure that the plugin sets up a clone\nin the same fashion as git-clone.\n\nSigned-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>\n---\n .../org/spearce/egit/core/op/CloneOperation.java   |   18 ++++++++++++++++++\n 1 files changed, 18 insertions(+), 0 deletions(-)\n\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java\nindex 777894c..b66c870 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java\n@@ -32,6 +32,7 @@\n import org.spearce.jgit.lib.Ref;\n import org.spearce.jgit.lib.RefUpdate;\n import org.spearce.jgit.lib.Repository;\n+import org.spearce.jgit.lib.RepositoryConfig;\n import org.spearce.jgit.lib.Tree;\n import org.spearce.jgit.lib.WorkDirCheckout;\n import org.spearce.jgit.transport.FetchResult;\n@@ -158,6 +159,23 @@ private void doInit(final IProgressMonitor monitor)\n \t\tlocal.getConfig().setBoolean(\"core\", null, \"bare\", false);\n \n \t\tremoteConfig.update(local.getConfig());\n+\n+\t\t// branch is like 'Constants.R_HEADS + branchName',\n+\t\t// we need the 'branchName' part only\n+\t\tString[] branchSplit = branch.split(Constants.R_HEADS);\n+\t\t\n+\t\t// setup the default remote branch for branchName\n+\t\tlocal.getConfig().setString(\n+\t\t\t\tRepositoryConfig.BRANCH_SECTION,\n+\t\t\t\tbranchSplit[branchSplit.length - 1],\n+\t\t\t\t\"remote\",\n+\t\t\t\tremoteName);\n+\t\tlocal.getConfig().setString(\n+\t\t\t\tRepositoryConfig.BRANCH_SECTION,\n+\t\t\t\tbranchSplit[branchSplit.length - 1],\n+\t\t\t\t\"merge\",\n+\t\t\t\tbranch);\n+\n \t\tlocal.getConfig().save();\n \t}\n \n-- \n1.6.0.6\n"}]}