Thread (7 messages) flat view 7 messages, 2 authors, 2016-06-15

[EGIT] [PATCH 2/2] Make sure to set up the default (pull) remote branch for master

From: <hidden>
Date: 2016-06-15 22:46:15
Subsystem: the rest · Maintainer: Linus Torvalds

From: Ferry Huberts <redacted>

This is to make sure that the git plugin sets up a clone
in the same fashion as the CLI git clone command.

Signed-off-by: Ferry Huberts <redacted>
---
 .../org/spearce/egit/core/op/CloneOperation.java   |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --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
index f9ff6a3..ad786cb 100644
--- 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
@@ -32,6 +32,7 @@
 import org.spearce.jgit.lib.Ref;
 import org.spearce.jgit.lib.RefUpdate;
 import org.spearce.jgit.lib.Repository;
+import org.spearce.jgit.lib.RepositoryConfig;
 import org.spearce.jgit.lib.Tree;
 import org.spearce.jgit.lib.WorkDirCheckout;
 import org.spearce.jgit.transport.FetchResult;
@@ -158,6 +159,11 @@ private void doInit(final IProgressMonitor monitor)
 		local.getConfig().setBoolean("core", null, "bare", false);
 		
 		remoteConfig.update(local.getConfig());
+
+		/* setup the default (pull) remote branch for master */
+		local.getConfig().setString(RepositoryConfig.BRANCH_SECTION, Constants.MASTER, "remote", remoteName);
+		local.getConfig().setString(RepositoryConfig.BRANCH_SECTION, Constants.MASTER, "merge", Constants.R_HEADS + Constants.MASTER);
+
 		local.getConfig().save();
 	}
 
-- 
1.6.0.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help