mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-07 16:22:40 +00:00
fix regression in diff with submodule oid
This commit is contained in:
parent
ad9a921b92
commit
a1bf70e4c9
17
src/diff.c
17
src/diff.c
@ -506,16 +506,15 @@ static int maybe_modified(
|
|||||||
/* if we got here and decided that the files are modified, but we
|
/* if we got here and decided that the files are modified, but we
|
||||||
* haven't calculated the OID of the new item, then calculate it now
|
* haven't calculated the OID of the new item, then calculate it now
|
||||||
*/
|
*/
|
||||||
if (status != GIT_DELTA_UNMODIFIED &&
|
if (status != GIT_DELTA_UNMODIFIED && git_oid_iszero(&nitem->oid)) {
|
||||||
git_oid_iszero(&nitem->oid) && !use_noid)
|
if (!use_noid) {
|
||||||
{
|
if (git_diff__oid_for_file(diff->repo,
|
||||||
if (git_diff__oid_for_file(diff->repo,
|
nitem->path, nitem->mode, nitem->file_size, &noid) < 0)
|
||||||
nitem->path, nitem->mode, nitem->file_size, &noid) < 0)
|
return -1;
|
||||||
return -1;
|
use_noid = &noid;
|
||||||
if (omode == nmode && git_oid_equal(&oitem->oid, &noid))
|
}
|
||||||
|
if (omode == nmode && git_oid_equal(&oitem->oid, use_noid))
|
||||||
status = GIT_DELTA_UNMODIFIED;
|
status = GIT_DELTA_UNMODIFIED;
|
||||||
/* store calculated oid so we don't have to recalc later */
|
|
||||||
use_noid = &noid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return diff_delta__from_two(
|
return diff_delta__from_two(
|
||||||
|
Loading…
Reference in New Issue
Block a user