diff options
author | Carlos Martín Nieto <carlosmn@github.com> | 2016-05-06 18:44:37 +0200 |
---|---|---|
committer | Carlos Martín Nieto <carlosmn@github.com> | 2016-05-06 18:44:37 +0200 |
commit | 17a93afa782ac8aebb37ecb98b928215f36e2008 (patch) | |
tree | 04eb0610dcb6c1c9d8da657c0ba21df3e02f4935 /src | |
parent | 2e43a37bcb14d324ab09de4801cb37cf2f31b9bb (diff) | |
parent | 5785ae9b5e315a2aca64ee4bac1b31bdab84c657 (diff) | |
download | libgit2-17a93afa782ac8aebb37ecb98b928215f36e2008.tar.gz |
Merge pull request #3757 from johnhaley81/jh/fix-create-initial-commit
Fix `git_commit_create` for an initial commit
Diffstat (limited to 'src')
-rw-r--r-- | src/commit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/commit.c b/src/commit.c index 5456751fe..79ddf2a63 100644 --- a/src/commit.c +++ b/src/commit.c @@ -104,7 +104,7 @@ static int validate_tree_and_parents(git_array_oid_t *parents, git_repository *r i++; } - if (current_id && git_oid_cmp(current_id, git_array_get(*parents, 0))) { + if (current_id && (parents->size == 0 || git_oid_cmp(current_id, git_array_get(*parents, 0)))) { giterr_set(GITERR_OBJECT, "failed to create commit: current tip is not the first parent"); error = GIT_EMODIFIED; goto on_error; |