Show merge conflict file names in the error message (#681)

This commit is contained in:
Mingshen Sun 2025-02-16 13:01:42 -08:00 committed by GitHub
parent 1d6785511a
commit fddd0c2563
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -528,11 +528,10 @@ extension PasswordNavigationViewController: PasswordAlertPresenter {
SVProgressHUD.showSuccess(withStatus: "Done".localize())
SVProgressHUD.dismiss(withDelay: 1)
}
} catch {
} catch let error as NSError {
gitCredential.delete()
DispatchQueue.main.async {
SVProgressHUD.dismiss()
let error = error as NSError
var message = error.localizedDescription
if let underlyingError = error.userInfo[NSUnderlyingErrorKey] as? NSError {
message = message | "UnderlyingError".localize(underlyingError.localizedDescription)
@ -540,6 +539,10 @@ extension PasswordNavigationViewController: PasswordAlertPresenter {
message = message | "RecoverySuggestion.".localize()
}
}
if let mergeConflictFiles = error.userInfo[GTPullMergeConflictedFiles] as? NSArray {
let mergeConflictFilesString = mergeConflictFiles.componentsJoined(by: ", ")
message = message | "MergeConflictError".localize(mergeConflictFilesString)
}
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(800)) {
Utils.alert(title: "Error".localize(), message: message, controller: self, completion: nil)
}