From ff43b3facfcfdb644e631eb74901190876ac0063 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Sat, 30 Jan 2021 17:27:51 -0600 Subject: [PATCH] =?UTF-8?q?fix(archival):=20=F0=9F=90=9B=20log=20and=20swa?= =?UTF-8?q?llow=20EmptyCommitExceptions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Persistence/GitListArchiveRepository.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/services/Archival/FilterLists.Archival.Infrastructure/Persistence/GitListArchiveRepository.cs b/services/Archival/FilterLists.Archival.Infrastructure/Persistence/GitListArchiveRepository.cs index 8509622f1..247b688b9 100644 --- a/services/Archival/FilterLists.Archival.Infrastructure/Persistence/GitListArchiveRepository.cs +++ b/services/Archival/FilterLists.Archival.Infrastructure/Persistence/GitListArchiveRepository.cs @@ -77,7 +77,14 @@ public void Commit() var signature = new Signature(_options.UserName, _options.UserEmail, DateTime.UtcNow); var message = $"feat(archives): archive {fileNames.Count} file(s){Environment.NewLine}{string.Join(Environment.NewLine, fileNames)}"; Commands.Stage(_repo, fileNames); - _repo.Commit(message, signature, signature); + try + { + _repo.Commit(message, signature, signature); + } + catch (EmptyCommitException ex) + { + _logger.LogInformation(ex, "No changes to commit for {@FileNames}", fileNames); + } _logger.LogInformation("Committed {@FileNames}", fileNames); }