Sync: Allow the git pull to fail

On a new repo, the git pull will fail as there isn't any content. We
really need to improve the overall error handling.
This commit is contained in:
Vishesh Handa
2019-01-17 14:56:46 +01:00
parent 15bb98e852
commit a53df954ba

View File

@ -105,8 +105,18 @@ class GitNoteRepository implements NoteRepository {
return true; return true;
} }
await gitPull(this.dirName); try {
await gitPush(this.dirName); await gitPull(this.dirName);
} on GitException catch (ex) {
print(ex);
}
try {
await gitPush(this.dirName);
} on GitException catch (ex) {
print(ex);
throw ex;
}
return true; return true;
} }