diff options
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/git')
| -rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/git/GitCommandExecutor.kt | 11 | ||||
| -rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/git/operation/SyncOperation.kt | 1 |
2 files changed, 1 insertions, 11 deletions
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"), |
