From 9d128482896da0d1e26ce89f42026b524617f7b6 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Tue, 2 Mar 2021 10:38:48 +0100 Subject: [PATCH] Setup: Init repo if something went wrong Again, I'm not sure what is going wrong, but I think it's better to just try and fix it, than reporting an error to over 100 users. Fixes APP-JR --- lib/setup/screens.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/setup/screens.dart b/lib/setup/screens.dart index e388654c..d1b2b0a2 100644 --- a/lib/setup/screens.dart +++ b/lib/setup/screens.dart @@ -427,6 +427,9 @@ class GitHostSetupScreenState extends State { var repoPath = p.join(basePath, widget.repoFolderName); try { + if (!await GitRepository.isValidRepo(repoPath)) { + await GitRepository.init(repoPath); + } var repo = await GitRepository.load(repoPath); await repo.removeRemote(widget.remoteName); } on Exception catch (e, stacktrace) {