mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 02:07:39 +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;
|
var remoteConfigured = repo.config.remotes.isNotEmpty;
|
||||||
if (remoteConfigured) {
|
if (remoteConfigured) {
|
||||||
// Code path for 'branch is null' exception
|
// Code path for 'branch is null' exception
|
||||||
var branches = await repo.branches();
|
var branch = await repo.currentBranch();
|
||||||
if (branches.isEmpty) {
|
if (branch == null) {
|
||||||
var remoteConfig = repo.config.remotes[0];
|
var remoteConfig = repo.config.remotes[0];
|
||||||
await cloneRemote(
|
await cloneRemote(
|
||||||
repoPath: repoPath,
|
repoPath: repoPath,
|
||||||
|
Reference in New Issue
Block a user