Skip to content

Commit

Permalink
cLib: Allow empty commits
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vHanda committed May 29, 2019
1 parent 457db38 commit 0cf647e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions gj_common/gitjournal.c
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion 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:
Expand Down

0 comments on commit 0cf647e

Please sign in to comment.