forgejo/cmd
Panagiotis "Ivory" Vasilopoulos dbeab2a0c3 chore: introduce gitNeeded bool in setup (#7348)
There are various commands of the Forgejo CLI that do not actually need Git, because i.e. they only issue network requests. Matter of fact, most occurrences do not actually require Git.

By removing the Git initialization, operations by e.g. the manager will not fail in the absence of a Git binary. This is mostly relevant for an in-the-works Landlock implementation, which aims to minimize access to paths depending on the situation. Although we should expect that Git will be installed on the same system that the user is running Forgejo from, it somewhat slows things down, whereas the same edge cases that we are trying to protect the user from _could_ be achieved by keeping the `setting.RepoRootPath` check.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7348
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
Co-committed-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
2025-03-31 16:35:20 +00:00
..
forgejo chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
actions.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
admin.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
admin_auth.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
admin_auth_ldap.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
admin_auth_ldap_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
admin_auth_oauth.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
admin_auth_stmp.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
admin_regenerate.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
admin_user.go Refactor to use urfave/cli/v2 (#25959) 2023-07-21 17:28:19 +08:00
admin_user_change_password.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
admin_user_create.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
admin_user_delete.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
admin_user_generate_access_token.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
admin_user_list.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
admin_user_must_change_password.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
cert.go [BRANDING] cosmetic s/Gitea/Forgejo/ in logs, messages, etc. 2024-02-05 16:02:14 +01:00
cmd.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
docs.go [BRANDING] cosmetic s/Gitea/Forgejo/ in logs, messages, etc. 2024-02-05 16:02:14 +01:00
doctor.go feat: use XORM EngineGroup instead of single Engine connection (#7212) 2025-03-30 11:34:02 +00:00
doctor_convert.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
doctor_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
dump.go refactor(cli): improve dump's temporary file handling (#7350) 2025-03-31 16:33:47 +00:00
dump_repo.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
dump_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
embedded.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
generate.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
hook.go chore: introduce gitNeeded bool in setup (#7348) 2025-03-31 16:35:20 +00:00
hook_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
keys.go chore: introduce gitNeeded bool in setup (#7348) 2025-03-31 16:35:20 +00:00
mailer.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
main.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
main_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
manager.go chore: introduce gitNeeded bool in setup (#7348) 2025-03-31 16:35:20 +00:00
manager_logging.go chore: introduce gitNeeded bool in setup (#7348) 2025-03-31 16:35:20 +00:00
migrate.go feat: use XORM EngineGroup instead of single Engine connection (#7212) 2025-03-30 11:34:02 +00:00
migrate_storage.go feat: use XORM EngineGroup instead of single Engine connection (#7212) 2025-03-30 11:34:02 +00:00
migrate_storage_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
restore_repo.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
serv.go chore: introduce gitNeeded bool in setup (#7348) 2025-03-31 16:35:20 +00:00
web.go feat: include a default robots.txt to reduce the impact of crawlers (#7387) 2025-03-30 11:28:19 +00:00
web_acme.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
web_graceful.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
web_https.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00