mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-13 06:30:51 +08:00
Detect a strange case
I'm really not sure what to do in these cases
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user