From 1c55546340eb84a298f7cd0f21c0cfb17590ffb1 Mon Sep 17 00:00:00 2001 From: Vishesh Handa <me@vhanda.in> Date: Fri, 27 Nov 2020 00:24:08 +0100 Subject: [PATCH] Only Print repository Info in Android It's only to diagnose a specific bug in Android. --- lib/repository.dart | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/repository.dart b/lib/repository.dart index 3a664742..471d4960 100644 --- a/lib/repository.dart +++ b/lib/repository.dart @@ -91,21 +91,23 @@ class Repository with ChangeNotifier { // // Debugging Info for https://github.com/GitJournal/GitJournal/issues/347 // - var foundDotGit = false; - await for (var file in repoDir.list()) { - if (p.basename(file.path) == '.git') { - foundDotGit = true; - Log.i(".git directory contents"); - await for (var file in Directory(file.path).list()) { - Log.i("${file.path}"); - } - break; - } - } - if (foundDotGit == false) { - Log.e("Directory exists but .git folder is missing?"); + if (Platform.isAndroid) { + var foundDotGit = false; await for (var file in repoDir.list()) { - Log.i("What is this: ${file.path}"); + if (p.basename(file.path) == '.git') { + foundDotGit = true; + Log.i(".git directory contents"); + await for (var file in Directory(file.path).list()) { + Log.i("${file.path}"); + } + break; + } + } + if (foundDotGit == false) { + Log.e("Directory exists but .git folder is missing?"); + await for (var file in repoDir.list()) { + Log.i("What is this: ${file.path}"); + } } }