mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-10 02:39:46 +00:00
index: assert required OID are non-NULL
This commit is contained in:
parent
d0780b8133
commit
e114bbac89
12
src/index.c
12
src/index.c
@ -963,14 +963,20 @@ static int index_entry_reuc_init(git_index_reuc_entry **reuc_out,
|
||||
*reuc_out = reuc = reuc_entry_alloc(path);
|
||||
GITERR_CHECK_ALLOC(reuc);
|
||||
|
||||
if ((reuc->mode[0] = ancestor_mode) > 0)
|
||||
if ((reuc->mode[0] = ancestor_mode) > 0) {
|
||||
assert(ancestor_oid);
|
||||
git_oid_cpy(&reuc->oid[0], ancestor_oid);
|
||||
}
|
||||
|
||||
if ((reuc->mode[1] = our_mode) > 0)
|
||||
if ((reuc->mode[1] = our_mode) > 0) {
|
||||
assert(our_oid);
|
||||
git_oid_cpy(&reuc->oid[1], our_oid);
|
||||
}
|
||||
|
||||
if ((reuc->mode[2] = their_mode) > 0)
|
||||
if ((reuc->mode[2] = their_mode) > 0) {
|
||||
assert(their_oid);
|
||||
git_oid_cpy(&reuc->oid[2], their_oid);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user