mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-04 10:38:49 +00:00
Validate struct versions in merge, revert
This commit is contained in:
parent
0eedacb06a
commit
86a05ef382
@ -1575,6 +1575,8 @@ int git_merge_trees(
|
|||||||
|
|
||||||
*out = NULL;
|
*out = NULL;
|
||||||
|
|
||||||
|
GITERR_CHECK_VERSION(given_opts, GIT_MERGE_TREE_OPTS_VERSION, "git_merge_tree_opts");
|
||||||
|
|
||||||
if ((error = merge_tree_normalize_opts(repo, &opts, given_opts)) < 0)
|
if ((error = merge_tree_normalize_opts(repo, &opts, given_opts)) < 0)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
@ -2427,6 +2429,8 @@ int git_merge(
|
|||||||
|
|
||||||
*out = NULL;
|
*out = NULL;
|
||||||
|
|
||||||
|
GITERR_CHECK_VERSION(given_opts, GIT_MERGE_OPTS_VERSION, "git_merge_opts");
|
||||||
|
|
||||||
if (their_heads_len != 1) {
|
if (their_heads_len != 1) {
|
||||||
giterr_set(GITERR_MERGE, "Can only merge a single branch");
|
giterr_set(GITERR_MERGE, "Can only merge a single branch");
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -179,6 +179,8 @@ int git_revert(
|
|||||||
|
|
||||||
assert(repo && commit);
|
assert(repo && commit);
|
||||||
|
|
||||||
|
GITERR_CHECK_VERSION(given_opts, GIT_REVERT_OPTS_VERSION, "git_revert_opts");
|
||||||
|
|
||||||
if ((error = git_repository__ensure_not_bare(repo, "revert")) < 0)
|
if ((error = git_repository__ensure_not_bare(repo, "revert")) < 0)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user