Setup the default remote and merge config in CloneCommand
Bug: 336621 Change-Id: I8c889d7b42f6f121d096acad1fada8e3752d74f9 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
This commit is contained in:
parent
3271bcee2b
commit
3dcbf375a8
|
@ -53,6 +53,7 @@
|
|||
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;
|
||||
|
@ -136,6 +137,12 @@ private FetchResult fetch(Repository repo, URIish u)
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue