I've tried to emulate reset --merge by pre-filtering the paths passed in to reset --hard. I think that it has the same basic semantics as reset --merge. I'm doing something like this pseudocode:
// Gather list of files modified in the index.
git_diff *index_diff;
git_diff_tree_to_index(&index_diff, repo, current_head_tree, ...);
// Iterate over index_diff to produce list of changed files.
// Gather list of files modified between index and workdir.
git_diff *workdir_diff;
git_diff_index_to_workdir(&workdir_diff, ...);
// Iterate over workdir_diff looking for files in the index list.
// Any non-conflicted files that are already in the index list
// cause the whole process to be aborted with an error. Can't reset
// merged files that have unstaged changes.
// The files in the index list are the ones that need to be reset.
git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
opts.checkout_strategy |= GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH;
opts.paths = index_list;
git_reset(repo, current_head_commit, GIT_RESET_HARD, opts);
Of course, that's probably not how it should be implemented in the library. There should probably be a checkout strategy that skips files that are modified in the workdir but not staged in the index. Then that could be combined with GIT_CHECKOUT_USE_OURS to throw away conflicted files.