mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-11 17:41:55 +00:00
Merge pull request #2828 from ethomson/treediff_dont_patch
diff: only compute patches when requested
This commit is contained in:
commit
2136240dbd
@ -284,11 +284,12 @@ int git_diff_foreach(
|
|||||||
if (git_diff_delta__should_skip(&diff->opts, patch.delta))
|
if (git_diff_delta__should_skip(&diff->opts, patch.delta))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ((error = diff_patch_init_from_diff(&patch, diff, idx)) < 0)
|
if ((error = diff_patch_invoke_file_callback(&patch, &xo.output)) == 0) {
|
||||||
break;
|
if (hunk_cb || data_cb) {
|
||||||
|
if ((error = diff_patch_init_from_diff(&patch, diff, idx)) == 0)
|
||||||
if (!(error = diff_patch_invoke_file_callback(&patch, &xo.output)))
|
|
||||||
error = diff_patch_generate(&patch, &xo.output);
|
error = diff_patch_generate(&patch, &xo.output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
git_patch_free(&patch);
|
git_patch_free(&patch);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user