Skip to content

Commit

Permalink
Merge pull request #361 from wakatime/bugfix/project-detection#recursion
Browse files Browse the repository at this point in the history
Fix infinite loop for Windows
  • Loading branch information
gandarez authored May 6, 2021
2 parents 3db2c2e + deb7392 commit 7a938b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/project/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func findGitConfigFile(fp string, directory string, match string) (string, bool)
}

dir := filepath.Clean(filepath.Join(fp, ".."))
if dir == "/" || driveLetterRegex.MatchString(dir) {
if dir == "." || dir == "/" || driveLetterRegex.MatchString(dir) {
return "", false
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/project/mercurial.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func findHgConfigDir(fp string) (string, bool) {
}

dir := filepath.Clean(filepath.Join(fp, ".."))
if dir == "/" {
if dir == "." || dir == "/" || driveLetterRegex.MatchString(dir) {
return "", false
}

Expand Down

0 comments on commit 7a938b5

Please sign in to comment.