From 5a0a26fe37f291d36509bf84cf8da19e2524a493 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Thu, 16 May 2019 11:36:48 +0200 Subject: [PATCH] cLib gitPull: The other parent can be the annotated commit What is an annotated commit? This library doesn't make much sense to me. The merge.c example for libgit2 also doesn't make that much sense. --- gj_common/gitjournal.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/gj_common/gitjournal.c b/gj_common/gitjournal.c index 6b334a84..3002ccfa 100644 --- a/gj_common/gitjournal.c +++ b/gj_common/gitjournal.c @@ -517,30 +517,16 @@ int gj_git_pull(const char *git_base_path, const char *author_name, const char * goto cleanup; // Get the parents - git_oid head_id, origin_head_id; + git_oid head_id; err = git_reference_name_to_id(&head_id, repo, "HEAD"); if (err < 0) goto cleanup; - git_object *obj = NULL; - err = git_revparse_single(&obj, repo, "6fb95a2ae97cc"); - if (err < 0) - goto cleanup; - - origin_head_id = *git_object_id(obj); - /* - err = git_reference_lookup(&head_id, repo, git_object_id(obj)); - if (err < 0) - goto cleanup; - */ - err = git_commit_lookup(&head_commit, repo, &head_id); if (err < 0) goto cleanup; - printf("Looked up head commit\n"); - - err = git_commit_lookup(&origin_head_commit, repo, &origin_head_id); + err = git_commit_lookup(&origin_head_commit, repo, git_annotated_commit_id(annotated_commit)); if (err < 0) goto cleanup;