Allow git pulls to fail

They fail when there is nothing to pull because no commit exists on the
server.
This commit is contained in:
Vishesh Handa
2020-01-02 01:04:21 +01:00
parent 4a322b6fc4
commit 72777b96a4

View File

@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:fimber/fimber.dart';
import 'package:git_bindings/git_bindings.dart';
@ -102,8 +103,18 @@ class GitNoteRepository {
}
Future<void> sync() async {
try {
await _gitRepo.pull();
} on GitException catch (ex) {
Fimber.d(ex.toString());
}
try {
await _gitRepo.push();
} on GitException catch (ex) {
Fimber.d(ex.toString());
rethrow;
}
}
}