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.
(path string)
| 537 | // |
| 538 | // TODO(unknwon): Move to repoutil during refactoring for this file. |
| 539 | func isRepositoryGitPath(path string) bool { |
| 540 | path = strings.ToLower(path) |
| 541 | return strings.HasSuffix(path, ".git") || |
| 542 | strings.Contains(path, ".git/") || |
| 543 | strings.Contains(path, `.git\`) || |
| 544 | // Windows treats ".git." the same as ".git" |
| 545 | strings.HasSuffix(path, ".git.") || |
| 546 | strings.Contains(path, ".git./") || |
| 547 | strings.Contains(path, `.git.\`) |
| 548 | } |
| 549 | |
| 550 | func (r *Repository) UploadRepoFiles(doer *User, opts UploadRepoFileOptions) error { |
| 551 | if len(opts.Files) == 0 { |
no outgoing calls