From 18719856b77ba38d83874bdafc1e27f7d9b8f37b Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Fri, 12 Feb 2021 15:33:00 +0100 Subject: [PATCH] Detect current branch null in the same way --- lib/repository.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/repository.dart b/lib/repository.dart index 5e0febd2..5da9d0c5 100644 --- a/lib/repository.dart +++ b/lib/repository.dart @@ -92,8 +92,8 @@ class Repository with ChangeNotifier { var remoteConfigured = repo.config.remotes.isNotEmpty; if (remoteConfigured) { // Code path for 'branch is null' exception - var branches = await repo.branches(); - if (branches.isEmpty) { + var branch = await repo.currentBranch(); + if (branch == null) { var remoteConfig = repo.config.remotes[0]; await cloneRemote( repoPath: repoPath,