forgejo/modules
Gusted 74981d9e97 chore: Refactor Is{Reference,Branch}Exist (#8425)
- Instead of invoking a new git command to check if a reference exists, use the already opened git repository that uses a batch check to check if the reference exists.
- Instead of invoking a new git command to check if a branch exists, use the already opened git repository that uses a batch check to check if the branch exists.
- Do not depend on `IsReferenceExist` as its no longer used by any other function.
- Specify `--quiet` to not waste Git's time on printing something we do not use.
- Run it via `Run` so no buffers are created for stdout and stderr.
- Add a test that verifies `IsBranchExist` works and does not work for other types of references.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8425
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-07-06 07:16:43 +02:00
..
actions [gitea] week 2025-22 cherry pick (gitea/main -> forgejo) (#8198) 2025-06-17 18:28:07 +02:00
activitypub Improved signature handling & instance actor (#8275) 2025-07-01 19:49:00 +02:00
analyze
assetfs feat: improve generation of bundled assets (#8143) 2025-06-11 09:36:18 +02:00
auth chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
avatar chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
base Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
cache chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
card chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
charset feat: update ambigious characters (#7988) 2025-05-29 10:00:12 +02:00
container chore: do not require empty fixtures to clean tables (#8353) 2025-06-30 23:04:16 +02:00
csv Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
emoji chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
eventsource chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
forgefed refactor & enhance AP elements used (#7728) 2025-06-02 22:29:10 +02:00
generate chore(sec): unify usage of crypto/rand.Read (#7453) 2025-04-04 03:31:37 +00:00
git chore: Refactor Is{Reference,Branch}Exist (#8425) 2025-07-06 07:16:43 +02:00
gitrepo chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
graceful Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
hcaptcha chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
highlight Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
hostmatcher Support allowed hosts for migrations to work with proxy (#32025) 2024-09-14 17:52:54 +02:00
html
httpcache chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
httplib feat: detect Interlisp sources as text (#8377) 2025-07-02 07:38:46 +02:00
indexer fix: skip empty tokens in SearchOptions.Tokens() (#8261) 2025-07-03 11:29:04 +02:00
issue/template chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
json
keying chore(sec): unify usage of crypto/rand.Read (#7453) 2025-04-04 03:31:37 +00:00
label chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
lfs feat: bump the minimum required Git version from 2.0.0 to 2.34.1 (#8328) 2025-06-29 00:44:18 +02:00
log feat: add a EXCLUSION to the logger (#8212) 2025-07-04 00:08:23 +02:00
markup fix(ui): add missing lazy load attribute to images (#8246) 2025-06-25 18:31:03 +02:00
mcaptcha chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
metrics chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
migration fix(migrations): transfer PR flow information (#7421) 2025-04-03 06:47:37 +00:00
nosql chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
optional Move ParseBool to optional (#33979) 2025-04-01 02:28:02 +02:00
options chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
packages feat: support artifact uploads for OCI container packages (#8070) 2025-06-09 10:14:53 +02:00
paginator
pprof chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
private chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
process Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
proxy chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
proxyprotocol chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
public add model viewer for .glb (GLTF) model in file view (#8111) 2025-06-21 14:42:35 +02:00
queue chore: QoL improvements to tests (#7917) 2025-05-21 15:45:56 +02:00
recaptcha chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
references fix: pull request cross references (#7979) 2025-05-28 14:50:05 +02:00
regexplru Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
repository feat: configurable default units for mirrors (#7902) 2025-06-03 08:12:29 +02:00
secret Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v1.64.6 (forgejo) (#7118) 2025-03-04 21:38:35 +00:00
session chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
setting feat: add a EXCLUSION to the logger (#8212) 2025-07-04 00:08:23 +02:00
sitemap Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
ssh chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
storage chore(ci): skip tests if TEST_{MINIO_ENDPOINT,ELASTICSEARCH_URL} is not set (#8166) 2025-06-12 21:13:52 +02:00
structs Improved signature handling & instance actor (#8275) 2025-07-01 19:49:00 +02:00
svg chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
sync chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
system Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
templates fix(ui): add missing lazy load attribute to images (#8246) 2025-06-25 18:31:03 +02:00
test Improved signature handling & instance actor (#8275) 2025-07-01 19:49:00 +02:00
testlogger feat: use XORM EngineGroup instead of single Engine connection (#7212) 2025-03-30 11:34:02 +00:00
timeutil Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
translation Replace the 'relative-time' element scripting with custom, translatable rewrite (#6154) 2025-05-03 14:11:01 +00:00
turnstile chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
typesniffer feat: detect Interlisp sources as text (#8377) 2025-07-02 07:38:46 +02:00
updatechecker chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
uri Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
user Drop SSPI auth support and more Windows files (#7148) 2025-03-08 00:43:41 +00:00
util blob: GetBlobContent: reduce allocations (#8223) 2025-06-19 18:36:12 +02:00
validation fix: allow instance API URLs in release assets (#7644) 2025-06-09 10:01:59 +02:00
web feat: make Forgejo Actions server logs less noisy (#7986) 2025-05-29 10:06:30 +02:00
webhook Actions Failure, Succes, Recover Webhooks (#7508) 2025-06-03 14:29:19 +02:00
zstd Cache generated binary across jobs 2024-08-26 23:43:09 +02:00