gitea/modules/git
Lunny Xiao fbe6d9dc6b
Use batch database operations instead of one by one to optimze api pulls ()
Resolve 

The response time for the Pull Requests API has improved significantly,
dropping from over `2000ms` to about `350ms` on my local machine. It's
about `6` times faster.

A key area for further optimization lies in batch-fetching data for
`apiPullRequest.ChangedFiles, apiPullRequest.Additions, and
apiPullRequest.Deletions`.

Tests `TestAPIViewPulls` does exist and new tests added.

- This PR also fixes some bugs in `GetDiff` functions.
- This PR also fixes data inconsistent in test data. For a pull request,
the head branch's reference should be equal to the reference in
`pull/xxx/head`.
..
foreachref Use refname:strip-2 instead of refname:short when syncing tags ()
internal Refactor git command package to improve security and maintainability ()
pipeline Refactor the usage of batch catfile ()
tests/repos Reduce integration test overhead ()
url Implement FSFE REUSE for golang files ()
README.md move code.gitea.io/git to code.gitea.io/gitea/modules/git ()
attribute.go Refactor git attributes ()
batch.go Refactor the usage of batch catfile ()
batch_reader.go Refactor LFS SSH and internal routers ()
blame.go Make sure git version&feature are always prepared ()
blame_sha256_test.go Add `TAGS` to `TEST_TAGS` and fix bugs found with gogit ()
blame_test.go Lazy load object format with command line and don't do it in OpenRepository ()
blob.go Fix profile render when the README.md size is larger than 1024 bytes ()
blob_gogit.go Abstract hash function usage ()
blob_nogogit.go Refactor the usage of batch catfile ()
blob_test.go Implement FSFE REUSE for golang files ()
command.go Support repo code search without setting up an indexer ()
command_race_test.go Implement FSFE REUSE for golang files ()
command_test.go Improve git log for debugging ()
commit.go Fix submodule parsing ()
commit_convert_gogit.go Refactor commit signature parser ()
commit_info.go Fix submodule parsing ()
commit_info_gogit.go Fix submodule parsing ()
commit_info_nogogit.go Fix submodule parsing ()
commit_info_test.go Implement FSFE REUSE for golang files ()
commit_reader.go Enable more `revive` linter rules ()
commit_sha256_test.go Lazy load object format with command line and don't do it in OpenRepository ()
commit_submodule.go Fix submodule parsing ()
commit_submodule_file.go Fix submodule parsing ()
commit_submodule_file_test.go Fix submodule parsing ()
commit_test.go Fix submodule parsing ()
config.go Fix submodule parsing ()
config_submodule.go Fix submodule parsing ()
config_submodule_test.go Fix submodule parsing ()
config_test.go Fix submodule parsing ()
diff.go Fix protected branch files detection on pre_receive hook ()
diff_test.go Implement FSFE REUSE for golang files ()
error.go Fix git error handling ()
fsck.go Fix submodule parsing ()
git.go Fix submodule parsing ()
git_test.go Fix submodule parsing ()
grep.go Improve grep search ()
grep_test.go Improve grep search ()
hook.go Implement FSFE REUSE for golang files ()
last_commit_cache.go Refactor cache and disable go-chi cache ()
last_commit_cache_gogit.go Abstract hash function usage ()
last_commit_cache_nogogit.go Implement FSFE REUSE for golang files ()
log_name_status.go bump to go 1.23 ()
notes.go Implement FSFE REUSE for golang files ()
notes_gogit.go Abstract hash function usage ()
notes_nogogit.go Implement FSFE REUSE for golang files ()
notes_test.go Implement FSFE REUSE for golang files ()
object_format.go Make sure git version&feature are always prepared ()
object_id.go Make sure git version&feature are always prepared ()
object_id_gogit.go Add support for sha256 repositories ()
object_id_test.go Fix incorrect object id hash function ()
parse_gogit.go Resolve lint for unused parameter and unnecessary type arguments ()
parse_gogit_test.go Resolve lint for unused parameter and unnecessary type arguments ()
parse_nogogit.go Resolve lint for unused parameter and unnecessary type arguments ()
parse_nogogit_test.go Resolve lint for unused parameter and unnecessary type arguments ()
ref.go Update misspell to 0.5.1 and add `misspellings.csv` ()
ref_test.go Use the type RefName for all the needed places and fix pull mirror sync bugs ()
remote.go Make sure git version&feature are always prepared ()
repo.go Support "merge upstream branch" (Sync fork) ()
repo_archive.go Fix archive creating LFS hooks and breaking pull requests ()
repo_attribute.go Fix git error handling ()
repo_attribute_test.go Refactor git attributes ()
repo_base_gogit.go Fix submodule parsing ()
repo_base_nogogit.go Fix submodule parsing ()
repo_blame.go Remove `git.FileBlame` ()
repo_blob.go Improve ObjectFormat interface ()
repo_blob_gogit.go Abstract hash function usage ()
repo_blob_nogogit.go Abstract hash function usage ()
repo_blob_test.go Improve ObjectFormat interface ()
repo_branch.go Move get/set default branch from git package to gitrepo package to hide repopath ()
repo_branch_gogit.go Fix `IsObjectExist` with gogit ()
repo_branch_nogogit.go Refactor the usage of batch catfile ()
repo_branch_test.go Fix `IsObjectExist` with gogit ()
repo_commit.go Fix protected branch files detection on pre_receive hook ()
repo_commit_gogit.go Fix gogit `GetRefCommitID` ()
repo_commit_nogogit.go Refactor the usage of batch catfile ()
repo_commit_test.go Fix gogit `GetRefCommitID` ()
repo_commitgraph.go Make sure git version&feature are always prepared ()
repo_commitgraph_gogit.go Update go dependencies and fix go-git ()
repo_compare.go Use batch database operations instead of one by one to optimze api pulls ()
repo_compare_test.go Lazy load object format with command line and don't do it in OpenRepository ()
repo_gpg.go Abstract hash function usage ()
repo_hook.go Implement FSFE REUSE for golang files ()
repo_index.go Fix clean tmp dir ()
repo_language_stats.go Refactor git attributes ()
repo_language_stats_gogit.go Refactor git attributes ()
repo_language_stats_nogogit.go Refactor the usage of batch catfile ()
repo_language_stats_test.go Merge different languages for language stats ()
repo_object.go Improve ObjectFormat interface ()
repo_ref.go Show branches and tags that contain a commit ()
repo_ref_gogit.go Abstract hash function usage ()
repo_ref_nogogit.go Improve ObjectFormat interface ()
repo_ref_test.go Fix commit retrieval by tag ()
repo_stats.go Fix some pending problems ()
repo_stats_test.go Fix commit retrieval by tag ()
repo_tag.go Refactor commit signature parser ()
repo_tag_gogit.go Fix submodule parsing ()
repo_tag_nogogit.go Fix submodule parsing ()
repo_tag_test.go Refactor commit signature parser ()
repo_test.go Faster git.GetDivergingCommits ()
repo_tree.go Improve ObjectFormat interface ()
repo_tree_gogit.go Add `TAGS` to `TEST_TAGS` and fix bugs found with gogit ()
repo_tree_nogogit.go Refactor the usage of batch catfile ()
signature.go Refactor parseSignatureFromCommitLine ()
signature_gogit.go Refactor parseSignatureFromCommitLine ()
signature_nogogit.go Refactor parseSignatureFromCommitLine ()
signature_test.go Refactor parseSignatureFromCommitLine ()
tag.go Refactor commit signature parser ()
tag_test.go Refactor commit signature parser ()
tree.go Abstract hash function usage ()
tree_blob.go Implement FSFE REUSE for golang files ()
tree_blob_gogit.go Abstract hash function usage ()
tree_blob_nogogit.go Implement FSFE REUSE for golang files ()
tree_entry.go Remember to attach the parent tree when converting TreeEntry() -> Tree() ()
tree_entry_gogit.go Abstract hash function usage ()
tree_entry_mode.go Implement FSFE REUSE for golang files ()
tree_entry_nogogit.go Refactor the usage of batch catfile ()
tree_entry_test.go Implement FSFE REUSE for golang files ()
tree_gogit.go Abstract hash function usage ()
tree_nogogit.go Refactor the usage of batch catfile ()
tree_test.go Discard unread data of `git cat-file` ()
utils.go Fix submodule parsing ()
utils_test.go Refactor sha1 and time-limited code ()

README.md

Git Module

This module is merged from https://github.com/go-gitea/git which is a Go module to access Git through shell commands. Now it's a part of gitea's main repository for easier pull request.