From 5715b59ed424a8aee963aa7f4857bba118d20ede Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 10 Aug 2020 19:19:01 +0530 Subject: Replicate key selection flow for directory creation (#999) * Replicate key selection flow Signed-off-by: Harsh Shandilya * Review fixes Signed-off-by: Harsh Shandilya * Set --user 0 in adb options to prevent automatically installing to work profile Signed-off-by: Harsh Shandilya * Fix committing regression Signed-off-by: Harsh Shandilya * Update changelog Signed-off-by: Harsh Shandilya --- .../main/java/com/zeapo/pwdstore/git/GitCommandExecutor.kt | 11 +---------- .../java/com/zeapo/pwdstore/git/operation/SyncOperation.kt | 1 - 2 files changed, 1 insertion(+), 11 deletions(-) (limited to 'app/src/main/java/com/zeapo/pwdstore/git') diff --git a/app/src/main/java/com/zeapo/pwdstore/git/GitCommandExecutor.kt b/app/src/main/java/com/zeapo/pwdstore/git/GitCommandExecutor.kt index 11b06b8e..24c42df2 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitCommandExecutor.kt +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitCommandExecutor.kt @@ -26,7 +26,6 @@ import org.eclipse.jgit.api.CommitCommand import org.eclipse.jgit.api.PullCommand import org.eclipse.jgit.api.PushCommand import org.eclipse.jgit.api.RebaseResult -import org.eclipse.jgit.api.StatusCommand import org.eclipse.jgit.transport.RemoteRefUpdate import org.eclipse.jgit.transport.SshSessionFactory @@ -43,22 +42,14 @@ class GitCommandExecutor( message = activity.resources.getString(R.string.git_operation_running), length = Snackbar.LENGTH_INDEFINITE, ) - var nbChanges = 0 var operationResult: Result = Result.Ok for (command in operation.commands) { try { when (command) { - is StatusCommand -> { - // in case we have changes, we want to keep track of it - val status = withContext(Dispatchers.IO) { - command.call() - } - nbChanges = status.changed.size + status.missing.size - } is CommitCommand -> { // the previous status will eventually be used to avoid a commit withContext(Dispatchers.IO) { - if (nbChanges > 0) command.call() + command.call() } } is PullCommand -> { diff --git a/app/src/main/java/com/zeapo/pwdstore/git/operation/SyncOperation.kt b/app/src/main/java/com/zeapo/pwdstore/git/operation/SyncOperation.kt index 6edf2994..223f2cd8 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/operation/SyncOperation.kt +++ b/app/src/main/java/com/zeapo/pwdstore/git/operation/SyncOperation.kt @@ -18,7 +18,6 @@ class SyncOperation(fileDir: File, callingActivity: AppCompatActivity) : GitOper override val commands = arrayOf( git.add().addFilepattern("."), - git.status(), git.commit().setAll(true).setMessage("[Android Password Store] Sync"), git.pull().setRebase(true).setRemote("origin"), git.push().setPushAll().setRemote("origin"), -- cgit v1.2.3