From 06d1124c19d17dda7499fff084ed28e8ac54e288 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Mon, 27 Jan 2020 19:03:30 +0100 Subject: [PATCH] Sync: Retry if the remote has changed This can happen if someone pushed between our pull and push. In this case lets just try again. --- lib/core/git_repo.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/core/git_repo.dart b/lib/core/git_repo.dart index f40ab872..2badb884 100644 --- a/lib/core/git_repo.dart +++ b/lib/core/git_repo.dart @@ -112,6 +112,9 @@ class GitNoteRepository { try { await _gitRepo.push(); } on GitException catch (ex) { + if (ex.cause == 'cannot push non-fastforwardable reference') { + return sync(); + } Fimber.d(ex.toString()); rethrow; }