fix: .git
can be a file or a directory
#6319
Merged
.git
can be a file or a directory
#6319