mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-08-06 15:21:21 +08:00
Handle branch is null bug
Hopefully I've now handled every single case of it.
This commit is contained in:
@ -93,7 +93,10 @@ class GitJournalRepo with ChangeNotifier {
|
||||
if (remoteConfigured) {
|
||||
// Code path for 'branch is null' exception
|
||||
var branch = await repo.currentBranch();
|
||||
if (branch == null) {
|
||||
var head = await repo.head();
|
||||
var branchConfig = repo.config.branch(branch);
|
||||
|
||||
if (branch == null || head == null || branchConfig == null) {
|
||||
var remoteConfig = repo.config.remotes[0];
|
||||
await cloneRemote(
|
||||
repoPath: repoPath,
|
||||
|
Reference in New Issue
Block a user