0

Currently I tried following options:

checkout_options.checkout_strategy = GIT_CHECKOUT_SAFE |
GIT_CHECKOUT_ALLOW_CONFLICTS |
GIT_CHECKOUT_CONFLICT_STYLE_MERGE;
checkout_options.checkout_strategy = GIT_CHECKOUT_SAFE |
GIT_CHECKOUT_CONFLICT_STYLE_MERGE;
checkout_options.checkout_strategy = GIT_CHECKOUT_SAFE |
GIT_CHECKOUT_ALLOW_CONFLICTS;

The most promising was the first set of flags – perform checkout even when conflicts are expected, and "Write normal merge files for conflicts", as header of *_STYLE_MERGE says. I had hoped that this sentence means that in files with conflicts, there gonna be the "<<<<<<<<<<< theirs", etc. preambles wrapping conflicting code blocks. Instead, the file is left untouched. Is there a way to have the preambles, etc. written to files?

Rob Luca
  • 153
  • 10
  • You mean conflicts between edited files in the workdir and files that are different between your current `HEAD` and the tree you're checking out? That is to say: are you trying to emulate `git checkout -m`? – Edward Thomson Aug 11 '16 at 17:28
  • @EdwardThomson: Yes, checkout -m, just tested it. I'm implementing fast forward – after fetch, I checkout the fetched tip and modify heads/ to point to it. – Rob Luca Aug 12 '16 at 09:29

0 Answers0