Detect a strange case

I'm really not sure what to do in these cases
This commit is contained in:
Vishesh Handa
2021-02-23 10:01:13 +01:00
parent f7ba16553f
commit a57a27b61d

View File

@ -79,15 +79,20 @@ class GitJournalRepo with ChangeNotifier {
Log.i("Loading Repo at path $repoPath");
var repoDir = Directory(repoPath);
var repoDirStat = repoDir.statSync();
if (repoDirStat.type != FileSystemEntityType.directory) {
if (!repoDir.existsSync()) {
Log.i("Calling GitInit for ${settings.folderName} at: $repoPath");
await GitRepository.init(repoPath);
settings.save();
}
var valid = await GitRepository.isValidRepo(repoPath);
if (!valid) {
// What happened that the directory still exists but the .git folder
// has disappeared?
}
var repo = await GitRepository.load(repoPath);
var remoteConfigured = repo.config.remotes.isNotEmpty;
if (remoteConfigured) {