From 0cf647e1b607375fdd9b6253dcd482c820cf88ad Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Wed, 29 May 2019 16:47:14 +0200 Subject: [PATCH] cLib: Allow empty commits Our empty commit check was faulty. If we had changes in the index (deleted files), it would still give an entry count of 0; Not sure how to fix this. Also bumping to a new version, as without this note deletion is broken. --- gj_common/gitjournal.c | 4 ++++ pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gj_common/gitjournal.c b/gj_common/gitjournal.c index 6331c341e..26f44dc98 100644 --- a/gj_common/gitjournal.c +++ b/gj_common/gitjournal.c @@ -180,12 +180,16 @@ int gj_git_commit(const char *git_base_path, const char *author_name, if (err < 0) goto cleanup; + /* + FIXME: This returns 0 when a file is set to be removed + How do we figure out when the index is empty? int numOps = git_index_entrycount(index); if (numOps == 0) { err = GJ_ERR_EMPTY_COMMIT; goto cleanup; } + */ err = git_signature_now(&sig, author_name, author_email); if (err < 0) diff --git a/pubspec.yaml b/pubspec.yaml index 8a4434c9f..07d5e04a5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: journal description: A Journaling App Built on top of Git -version: 1.1.2+10 +version: 1.1.3+10 dependencies: flutter: