Introduce core.keepHardLinks
When a tracked file was hard linked, we used to break the hard link
whenever Git writes to that file.
In some situations, this behavior is less-than-desirable, especially
given the fact that some popular editors do not do that, such as
(in alphabetical order) emacs and vi.
So teach Git not to break hard links when the config variable
core.keepHardLinks is set to true. For backwards compatibility, this
variable defaults to false.
From a safety viewpoint, nothing really changes, as to keep hard links,
Git will now open the files it updates with O_TRUNC instead of deleting
them first and then opening them with O_EXCL.
To keep the implementation simple, mode changes will still break the
hard links.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>