Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions internal/utils/git_ignore.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ func NewGitIgnore(baseDir string) GitIgnore {
}

func (i GitIgnore) SkipFile(path string) (bool, error) {
// Never skip the .git directory or files inside it, even if matched by .gitignore patterns.
if path == ".git" || strings.HasPrefix(path, ".git/") || strings.HasPrefix(path, ".git\\") {
return false, nil
}
Comment thread
andy1li marked this conversation as resolved.

for _, ignorer := range []*ignore.GitIgnore{i.localGitIgnore, i.globalGitIgnore, i.gitInfoExclude} {
if ignorer != nil && ignorer.MatchesPath(path) {
return true, nil
Expand Down