Detect current branch null in the same way

This commit is contained in:
Vishesh Handa
2021-02-12 15:33:00 +01:00
parent 2c1504f9a8
commit 18719856b7

View File

@ -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,