diff options
author | Chris Aniszczyk <caniszczyk@gmail.com> | 2011-02-08 08:18:18 -0600 |
---|---|---|
committer | Chris Aniszczyk <caniszczyk@gmail.com> | 2011-02-13 15:33:45 -0600 |
commit | 3dcbf375a804019a8918642d79ca72549f03290a (patch) | |
tree | 91d3b5427f4942ed8b7bfd9e11c4b73d89d5e1e0 /org.eclipse.jgit | |
parent | 3271bcee2bc37b45da048cbd64c29c3cba1ea16b (diff) | |
download | jgit-3dcbf375a804019a8918642d79ca72549f03290a.tar.gz jgit-3dcbf375a804019a8918642d79ca72549f03290a.zip |
Setup the default remote and merge config in CloneCommand
Bug: 336621
Change-Id: I8c889d7b42f6f121d096acad1fada8e3752d74f9
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java index 87a7c30e86..b0837e5bb5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java @@ -53,6 +53,7 @@ import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.dircache.DirCacheCheckout; import org.eclipse.jgit.errors.IncorrectObjectTypeException; import org.eclipse.jgit.errors.MissingObjectException; +import org.eclipse.jgit.lib.ConfigConstants; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.NullProgressMonitor; import org.eclipse.jgit.lib.ProgressMonitor; @@ -69,7 +70,7 @@ import org.eclipse.jgit.transport.URIish; /** * Clone a repository into a new working directory - * + * * @see <a href="http://www.kernel.org/pub/software/scm/git/docs/git-clone.html" * >Git documentation about Clone</a> */ @@ -136,6 +137,12 @@ public class CloneCommand implements Callable<Git> { config.addFetchRefSpec(refSpec); config.update(repo.getConfig()); + + repo.getConfig().setString(ConfigConstants.CONFIG_BRANCH_SECTION, + branch, ConfigConstants.CONFIG_REMOTE_SECTION, remote); + repo.getConfig().setString(ConfigConstants.CONFIG_BRANCH_SECTION, + branch, ConfigConstants.CONFIG_KEY_MERGE, branch); //$NON-NLS-1$ //$NON-NLS-2$ + repo.getConfig().save(); // run the fetch command |