how to print diff files in libgit2?
问题 I tried this string path = "path/to/my/repo"; git_libgit2_init(); const char * REPO_PATH = path.c_str(); git_repository * repo = nullptr; git_repository_open(&repo, REPO_PATH); git_diff_options diffopts = GIT_DIFF_OPTIONS_INIT; git_diff *diff; diffopts.flags = GIT_CHECKOUT_NOTIFY_CONFLICT; git_diff_index_to_workdir(&diff, repo, NULL, &diffopts); git_diff_format_t format = GIT_DIFF_FORMAT_NAME_ONLY; if (0!=git_diff_print(diff, format, NULL,NULL)) cerr << "git_diff_print() failed" << endl; git