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,