Improve clone operation semantics (#1010)
* Improve clone operation semantics Fixes #1003 Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * Update changelog Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
52e2139f6a
commit
372c0f3dbd
3 changed files with 13 additions and 2 deletions
|
@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file.
|
||||||
- Allow creating nested directories directly
|
- Allow creating nested directories directly
|
||||||
- I keep saying this but for real: error message for wrong SSH/HTTPS password is properly fixed now
|
- I keep saying this but for real: error message for wrong SSH/HTTPS password is properly fixed now
|
||||||
- Fix crash when OpenKeychain is not installed
|
- Fix crash when OpenKeychain is not installed
|
||||||
|
- Clone operation won't leave user on an empty password list upon failure
|
||||||
|
|
||||||
## [1.10.3] - 2020-07-30
|
## [1.10.3] - 2020-07-30
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,15 @@ class CloneOperation(fileDir: File, uri: String, callingActivity: AppCompatActiv
|
||||||
)
|
)
|
||||||
|
|
||||||
override suspend fun execute() {
|
override suspend fun execute() {
|
||||||
GitCommandExecutor(callingActivity, this).execute()
|
GitCommandExecutor(callingActivity, this, finishActivityOnEnd = false).execute()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess() {
|
||||||
|
callingActivity.finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onError(err: Exception) {
|
||||||
|
finishFromErrorDialog = false
|
||||||
|
super.onError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@ abstract class GitOperation(gitDir: File, internal val callingActivity: Fragment
|
||||||
private var provider: CredentialsProvider? = null
|
private var provider: CredentialsProvider? = null
|
||||||
private val sshKeyFile = callingActivity.filesDir.resolve(".ssh_key")
|
private val sshKeyFile = callingActivity.filesDir.resolve(".ssh_key")
|
||||||
private val hostKeyFile = callingActivity.filesDir.resolve(".host_key")
|
private val hostKeyFile = callingActivity.filesDir.resolve(".host_key")
|
||||||
|
protected var finishFromErrorDialog = true
|
||||||
protected val repository = PasswordRepository.getRepository(gitDir)
|
protected val repository = PasswordRepository.getRepository(gitDir)
|
||||||
protected val git = Git(repository)
|
protected val git = Git(repository)
|
||||||
protected val remoteBranch = GitSettings.branch
|
protected val remoteBranch = GitSettings.branch
|
||||||
|
@ -166,7 +167,7 @@ abstract class GitOperation(gitDir: File, internal val callingActivity: Fragment
|
||||||
.setTitle(callingActivity.resources.getString(R.string.jgit_error_dialog_title))
|
.setTitle(callingActivity.resources.getString(R.string.jgit_error_dialog_title))
|
||||||
.setMessage(ErrorMessages[err])
|
.setMessage(ErrorMessages[err])
|
||||||
.setPositiveButton(callingActivity.resources.getString(R.string.dialog_ok)) { _, _ ->
|
.setPositiveButton(callingActivity.resources.getString(R.string.dialog_ok)) { _, _ ->
|
||||||
callingActivity.finish()
|
if (finishFromErrorDialog) callingActivity.finish()
|
||||||
}.show()
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue