             }()
             present(overwriteAlert, animated: true)
         } else {
-            cloneAndSegueIfSuccess()
-        }
-    }
-
-    private func cloneAndSegueIfSuccess() {
+            cloneAndSegueIfSuccess(url: gitURL, branch: branchName, username: username)
+        }
+    }
+
+    private func cloneAndSegueIfSuccess(url: URL, branch: String, username: String) {
+        gitURL = url
+        gitBranchName = branch
+        gitUsername = username
+
         // Remember git credential password/passphrase temporarily, ask whether users want this after a successful clone.
         Defaults.isRememberGitCredentialPassphraseOn = true
         DispatchQueue.global(qos: .userInitiated).async {

            return
        }

        guard let branchName = branchNameTextField.text, !branchName.trimmed.isEmpty else {
            Utils.alert(title: "CannotSave".localize(), message: "SpecifyBranchName.".localize(), controller: self)
            return
        }

            }
        }

        let username = (gitURL.user ?? usernameTextField.text ?? "git").trimmed

        if passwordStore.repositoryExists() {
            let overwriteAlert: UIAlertController = {
                let alert = UIAlertController(title: "Overwrite?".localize(), message: "OperationWillOverwriteData.".localize(), preferredStyle: .alert)
                alert.addAction(
                    UIAlertAction(title: "Overwrite".localize(), style: .destructive) { _ in
                        self.cloneAndSegueIfSuccess(url: gitURL, branch: branchName, username: username)
                    }
                )
                alert.addAction(UIAlertAction.cancel())
