mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-27 09:06:43 +08:00
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:
@ -105,8 +105,18 @@ class GitNoteRepository implements NoteRepository {
|
||||
return true;
|
||||
}
|
||||
|
||||
await gitPull(this.dirName);
|
||||
await gitPush(this.dirName);
|
||||
try {
|
||||
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user