Rewrite test to get expected filemodes with `stat`

Apparently `git` only recognizes three file modes: normal, executable,
and symlink. The actual FS mode of executable files depends on the OS and on
the way `git` is configured. So, the expected modes cannot be hard-coded.