Fix the logic of git clone

- erase git password and ssh passphrase before cloning
- erase core data after a failed cloning
This commit is contained in:
Yishi Lin 2017-08-12 21:41:34 +08:00
parent aa4ff7ce47
commit 6d118eab7e
3 changed files with 15 additions and 7 deletions

View file

@ -176,8 +176,8 @@ class GitServerSettingTableViewController: UITableViewController {
}
if passwordStore.repositoryExisted() {
let alert = UIAlertController(title: "Erase Current Password Store Data?", message: "A cloned password store exists. This operation will erase all local data. Data on your remote server will not be affected.", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Erase", style: UIAlertActionStyle.destructive, handler: { _ in
let alert = UIAlertController(title: "Overwrite?", message: "This operation will overwrite your current password store data (repository). Data on your remote server will not be affected.", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Overwrite", style: UIAlertActionStyle.destructive, handler: { _ in
// perform segue only after a successful clone
self.cloneAndSegueIfSuccess()
}))