newvers.sh: fix git false positive -dirty tag
Assuming that any output from git diff-index --name-only implies
changes in the working tree results in false positives: files with
metadata, but not content, changes are also listed.
Check that content differences exist before adding the -dirty tag to
the git hash.
PR: 229230
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15968
(cherry picked from commit 50b53a8dc35f38ab6920dd83409541e875d01551)
(cherry picked from commit 5186028dc4a2a74d007fa65857667efb2742eaea)