forgejo/services/pull
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
..
check.go fix: do not ignore automerge while a PR is checking for conflicts (#8189) 2025-06-17 10:58:07 +02:00
check_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
comment.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
commit_status.go chore: Refactor Is{Reference,Branch}Exist (#8425) 2025-07-06 07:16:43 +02:00
commit_status_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
edits.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
lfs.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
main_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
merge.go [gitea] Always use an empty line to separate the commit message and trailer (#8041) 2025-06-02 22:10:59 +02:00
merge_ff_only.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
merge_merge.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
merge_prepare.go feat: use git-replay for rebasing (#7527) 2025-04-29 20:51:56 +00:00
merge_rebase.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
merge_squash.go [gitea] Always use an empty line to separate the commit message and trailer (#8041) 2025-06-02 22:10:59 +02:00
merge_test.go [gitea] Always use an empty line to separate the commit message and trailer (#8041) 2025-06-02 22:10:59 +02:00
patch.go feat: improved performances when checking for conflicts on pull requests (#7727) 2025-05-16 12:40:38 +00:00
patch_test.go feat: improved performances when checking for conflicts on pull requests (#7727) 2025-05-16 12:40:38 +00:00
patch_unmerged.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
pull.go feat: improved performances when checking for conflicts on pull requests (#7727) 2025-05-16 12:40:38 +00:00
pull_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
review.go chore: refactor LineBlame (#8419) 2025-07-05 16:31:53 +02:00
review_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
temp_repo.go feat: bump the minimum required Git version from 2.0.0 to 2.34.1 (#8328) 2025-06-29 00:44:18 +02:00
update.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
update_rebase.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00