mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 01:45:55 +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;
|
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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user