diff: parse patches with sha256

This commit is contained in:
Edward Thomson
2023-04-07 15:28:58 +01:00
parent 7f70484799
commit db2a794dda
24 changed files with 307 additions and 139 deletions

View File

@@ -188,9 +188,17 @@ static void compute_diff_no_index(git_diff **diff, struct diff_options *o) {
check_lg2(
git_patch_to_buf(&buf, patch),
"patch to buf", NULL);
#ifdef GIT_EXPERIMENTAL_SHA256
check_lg2(
git_diff_from_buffer(diff, buf.ptr, buf.size, NULL),
"diff from patch", NULL);
#else
check_lg2(
git_diff_from_buffer(diff, buf.ptr, buf.size),
"diff from patch", NULL);
#endif
git_patch_free(patch);
git_buf_dispose(&buf);
free(file1_str);