Skip to content

Commit 23a6abd

Browse files
committed
Fixed path issue for '.git' as well
1 parent daa4f1f commit 23a6abd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

utils.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,12 @@ func IsFont(path string) bool {
217217

218218
// check for the `.git` folder
219219
func IsGitFolder(path string) bool {
220-
if strings.HasSuffix(path, string(os.PathSeparator)+".git") {
220+
// checks for the ".git" folder itself, i.e. for a path that ends with `/.git`
221+
// ... or for files within the ".git" folder, i.e. for a path that contains `/.git/`
222+
gitFolderPath := string(os.PathSeparator) + ".git"
223+
fileInGitFolderPath := gitFolderPath + string(os.PathSeparator)
224+
225+
if strings.HasSuffix(path, gitFolderPath) || strings.Contains(path, fileInGitFolderPath) {
221226
if !didPrintGitFolderMsg {
222227
log.Info("\tIgnoring `.git`")
223228
didPrintGitFolderMsg = true

0 commit comments

Comments
 (0)