Lines 33-42
Link Here
|
33 |
import org.eclipse.jgit.api.Git; |
33 |
import org.eclipse.jgit.api.Git; |
34 |
import org.eclipse.jgit.api.MergeResult.MergeStatus; |
34 |
import org.eclipse.jgit.api.MergeResult.MergeStatus; |
35 |
import org.eclipse.jgit.api.PullResult; |
35 |
import org.eclipse.jgit.api.PullResult; |
|
|
36 |
import org.eclipse.jgit.lib.ConfigConstants; |
36 |
import org.eclipse.jgit.lib.Constants; |
37 |
import org.eclipse.jgit.lib.Constants; |
37 |
import org.eclipse.jgit.lib.Repository; |
38 |
import org.eclipse.jgit.lib.Repository; |
38 |
import org.eclipse.jgit.lib.RepositoryCache; |
39 |
import org.eclipse.jgit.lib.RepositoryCache; |
39 |
import org.eclipse.jgit.lib.RepositoryState; |
40 |
import org.eclipse.jgit.lib.RepositoryState; |
|
|
41 |
import org.eclipse.jgit.lib.StoredConfig; |
40 |
import org.eclipse.jgit.transport.URIish; |
42 |
import org.eclipse.jgit.transport.URIish; |
41 |
import org.eclipse.jgit.util.FS; |
43 |
import org.eclipse.jgit.util.FS; |
42 |
import org.eclipse.orion.internal.server.core.IOUtilities; |
44 |
import org.eclipse.orion.internal.server.core.IOUtilities; |
Lines 667-674
Link Here
|
667 |
JSONArray clonesArray = clones.getJSONArray(ProtocolConstants.KEY_CHILDREN); |
669 |
JSONArray clonesArray = clones.getJSONArray(ProtocolConstants.KEY_CHILDREN); |
668 |
assertEquals(1, clonesArray.length()); |
670 |
assertEquals(1, clonesArray.length()); |
669 |
|
671 |
|
670 |
Git git = new Git(getRepositoryForContentLocation(contentLocation)); |
672 |
Repository r = getRepositoryForContentLocation(contentLocation); |
|
|
673 |
|
674 |
// overwrite user settings, do not rebase when pulling, see bug 372489 |
675 |
StoredConfig cfg = r.getConfig(); |
676 |
cfg.setBoolean(ConfigConstants.CONFIG_BRANCH_SECTION, Constants.MASTER, ConfigConstants.CONFIG_KEY_REBASE, false); |
677 |
cfg.save(); |
678 |
|
671 |
// TODO: replace with RESTful API when ready, see bug 339114 |
679 |
// TODO: replace with RESTful API when ready, see bug 339114 |
|
|
680 |
Git git = new Git(r); |
672 |
PullResult pullResult = git.pull().call(); |
681 |
PullResult pullResult = git.pull().call(); |
673 |
assertEquals(pullResult.getMergeResult().getMergeStatus(), MergeStatus.ALREADY_UP_TO_DATE); |
682 |
assertEquals(pullResult.getMergeResult().getMergeStatus(), MergeStatus.ALREADY_UP_TO_DATE); |
674 |
assertEquals(RepositoryState.SAFE, git.getRepository().getRepositoryState()); |
683 |
assertEquals(RepositoryState.SAFE, git.getRepository().getRepositoryState()); |