- Move the skip path check outside the `file.IsDir()` condition, so it can be used to skip files. - Add unit tests. - Resolves https://codeberg.org/forgejo/forgejo/issues/1397 - Ref: https://codeberg.org/forgejo/forgejo/pulls/1438