Recently I had to write some automation scripts and I found that git reset --hard actually restores each file's permissions.
That is causing both the created and the last-modified dates of the file to get changed to the time of the git reset.
This behavior is easy to demonstrate:
echo "test" > myfile
chmod 777 myfile
git add myfile && git commit -m "Test" & the only solution I'm able to think about is actually restoring the permissions of each file to the ones git thinks they should have before doing the git reset.
Maybe I'm wrong and there is a way for doing what I want, if so, please correct me. But if there isn't, should this be implemented? Are there any reasons for not doing it?