mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-15 07:56:11 +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");
|
Log.i("Loading Repo at path $repoPath");
|
||||||
|
|
||||||
var repoDir = Directory(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");
|
Log.i("Calling GitInit for ${settings.folderName} at: $repoPath");
|
||||||
await GitRepository.init(repoPath);
|
await GitRepository.init(repoPath);
|
||||||
|
|
||||||
settings.save();
|
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 repo = await GitRepository.load(repoPath);
|
||||||
var remoteConfigured = repo.config.remotes.isNotEmpty;
|
var remoteConfigured = repo.config.remotes.isNotEmpty;
|
||||||
if (remoteConfigured) {
|
if (remoteConfigured) {
|
||||||
|
Reference in New Issue
Block a user