Backport !7967 and !8189 to `8-13-stable`

Merged username-removed-128633 requested to merge backport-7967-and-8189-to-8-13-stable into 8-13-stable

What does this MR do?

This backport fixes for Git 2.11 to the 8-13-stable branch so that Debian packagers can prepare a new release.

Are there points in the code the reviewer needs to double check?

I've marked this as WIP since it depends on Other than that, nothing to note.

Why was this MR needed?

From @balasankarc:

Can someone help me with backporting git 2.11 patch to 8.13.x ? How complex is it?

Our Debian native package requires it and we are going for a hard freeze tomorrow. So, I kinda need to fix it tomorrow. It would be awesome if someone could give some pointers.

Does this MR meet the acceptance criteria?

/cc @balasankarc