Subject: Re: A puzzle: reset --hard and hard links

From: Junio C Hamano <[email-masked]>
Date: Mon, 24 Jan 2022 10:07:13 -0800

Michael Herrmann <[email-masked]> writes:

> I now believe this is a bug in Git because calling `git status` fixes
> the problem.
>
> 1) Create a hard link to a file in a Git repo.
> 2) Call `git status`.
> 3) Call `git reset --hard`.

It is merely because you helped Git to realize that there is no need
to change the contents of hte file with "reset --hard".

With another step 1.5 "append a line to the file in question", git
should severe the link, I would think, as at that point, to revert
the contents of the file in question to its pristine state, it needs
to modify it.