I'm not familiar with all the recommended traps[1]. Also I prefer to
list them by name. If the number is preferred, I'll change them without
hesitation. I changed the visibility of the local file/dir variables so
the function called by trap can catch it, again if any other approach is
preferred, just let me know.
I have updated/rebased the branch thatalso include D46789 and D46804:
https://github.com/jlduran/freebsd-src/commits/fix-git-arc-consolidated/
[1]: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_29