only strip whitespace on regular files

this was causing issues with symlinks, which git stores
as a text file (plus an appropriate file handle), and
striping space would cause the file to have a newline,
which is nonsense for file paths