0

I m trying to use libgit2 to made a pull/merge/push from and to a remote repository.

Unfortunatly look like i use it wrong.

So basically i do a pull, then try to merge it with merge_head_from_fetchhead

When i look at the result, the merge commit have two commit parent which are the same, and file from remote are missing.

Code is located here : Code on Gist : NotesModel.cpp line 85 The method trying to do the Pull Merge Push is void NotesModel::pullMergePush() Yeah i know, that s original :)

Thx a lot

Khertan
  • 93
  • 7

1 Answers1

5

You're never calling git_merge to do the merge. You're setting up a merge_head, which is what describes the changes you want to merge, then immediately freeing it.

You need to pass the merge_head to git_merge.

Edward Thomson
  • 74,857
  • 14
  • 158
  • 187