mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-27 17:29:50 +08:00
Detect current branch null in the same way
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user