GitMerge: For now just take THEIRS as the Merge Strategy

In the future, our strategy can be that we take whichever file has been
modified the latest. That's actually far more reasonable.
This commit is contained in:
Vishesh Handa
2019-01-15 15:39:17 +01:00
parent 315414ae73
commit 6db080b5f4

View File

@ -9,6 +9,7 @@ import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.PullCommand; import org.eclipse.jgit.api.PullCommand;
import org.eclipse.jgit.api.TransportConfigCallback; import org.eclipse.jgit.api.TransportConfigCallback;
import org.eclipse.jgit.api.errors.TransportException; import org.eclipse.jgit.api.errors.TransportException;
import org.eclipse.jgit.merge.MergeStrategy;
import org.eclipse.jgit.transport.Transport; import org.eclipse.jgit.transport.Transport;
import org.eclipse.jgit.transport.SshTransport; import org.eclipse.jgit.transport.SshTransport;
@ -34,7 +35,7 @@ public class GitPullTask extends AsyncTask<String, Void, Void> {
try { try {
Git git = Git.open(cloneDir); Git git = Git.open(cloneDir);
PullCommand pullCommand = git.pull(); PullCommand pullCommand = git.pull().setStrategy(MergeStrategy.THEIRS);
pullCommand.setTransportConfigCallback(new TransportConfigCallback() { pullCommand.setTransportConfigCallback(new TransportConfigCallback() {
@Override @Override
public void configure(Transport transport) { public void configure(Transport transport) {