Fixes #3531,#3899: Backport the GIT lock nuking promise from 2.5
Merge pull request #178 from Kegeruneku/ust_3531/dev/3899_backport_git_lock_nuking_from_2_5

Fixes #3531,#3899: Backport the GIT lock nuking promise from 2.5