Put the rebase abort in an async task

uhum... there was network operation
This commit is contained in:
zeapo 2017-08-11 09:37:09 +02:00
parent 040f000d99
commit 552f3fe5a5

View file

@ -520,16 +520,21 @@ public class GitActivity extends AppCompatActivity {
} }
public void abortRebase(View view) { public void abortRebase(View view) {
Repository repo = PasswordRepository.getRepository(PasswordRepository.getRepositoryDirectory(getApplicationContext())); final Repository repo = PasswordRepository.getRepository(PasswordRepository.getRepositoryDirectory(getApplicationContext()));
if (repo != null) { if (repo != null) {
try { new GitOperation(PasswordRepository.getRepositoryDirectory(activity), activity) {
// no network or heavy computation done, it's ok to do it on the ui-thread @Override
new Git(repo).rebase().setOperation(RebaseCommand.Operation.ABORT).call(); public void execute() {
} catch (Exception e) { Log.d(TAG, "Resetting the repository");
//ignore assert repository != null;
} finally { GitAsyncTask tasks = new GitAsyncTask(activity, false, true, this);
showGitConfig(); tasks.execute(new Git(repo).rebase().setOperation(RebaseCommand.Operation.ABORT));
} }
@Override
public void onSuccess() {
showGitConfig();
}
}.execute();
} }
} }