aboutsummaryrefslogtreecommitdiff
path: root/internal/db/repo_editor.go
diff options
context:
space:
mode:
authorJoe Chen <jc@unknwon.io>2023-02-18 22:15:13 +0800
committerGitHub <noreply@github.com>2023-02-18 22:15:13 +0800
commit15d0d6a94be0098a8227b6b95bdf2daed105ec41 (patch)
tree11508785272d2fbe5d6d136c0448b67bdd51e033 /internal/db/repo_editor.go
parent0f8c71d3b3fb55b2dad798dcd7594845e5dbe038 (diff)
fix(db): correctly check Git path on case-insensitive file system (#7359)
Diffstat (limited to 'internal/db/repo_editor.go')
-rw-r--r--internal/db/repo_editor.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/db/repo_editor.go b/internal/db/repo_editor.go
index 3edb16e2..0a1c9495 100644
--- a/internal/db/repo_editor.go
+++ b/internal/db/repo_editor.go
@@ -485,7 +485,10 @@ type UploadRepoFileOptions struct {
// isRepositoryGitPath returns true if given path is or resides inside ".git"
// path of the repository.
+//
+// TODO(unknwon): Move to repoutil during refactoring for this file.
func isRepositoryGitPath(path string) bool {
+ path = strings.ToLower(path)
return strings.HasSuffix(path, ".git") ||
strings.Contains(path, ".git/") ||
strings.Contains(path, `.git\`) ||