mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-21 14:39:10 +00:00
Fix submodule dirty states not showing if submodules comes before files, or there are only dirty submodules but no changed files
GIT_DIFF_PATCH_DIFFABLE was not set, so the diff content was not shown When submodule is dirty, the hash may be the same, but the length is different because -dirty is appended We can therefore compare the length or hash
This commit is contained in:
parent
fc12a6b545
commit
94750e8af2
@ -678,7 +678,8 @@ cleanup:
|
|||||||
if ((delta->flags & GIT_DIFF_FLAG_BINARY) == 0 &&
|
if ((delta->flags & GIT_DIFF_FLAG_BINARY) == 0 &&
|
||||||
delta->status != GIT_DELTA_UNMODIFIED &&
|
delta->status != GIT_DELTA_UNMODIFIED &&
|
||||||
(patch->old_data.len || patch->new_data.len) &&
|
(patch->old_data.len || patch->new_data.len) &&
|
||||||
!git_oid_equal(&delta->old_file.oid, &delta->new_file.oid))
|
((patch->old_data.len != patch->new_data.len) ||
|
||||||
|
!git_oid_equal(&delta->old_file.oid, &delta->new_file.oid)))
|
||||||
patch->flags |= GIT_DIFF_PATCH_DIFFABLE;
|
patch->flags |= GIT_DIFF_PATCH_DIFFABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user