]> source.dussan.org Git - gitea.git/commit
Lazy load object format with command line and don't do it in OpenRepository (#29712)
authorLunny Xiao <xiaolunwen@gmail.com>
Tue, 12 Mar 2024 04:21:27 +0000 (12:21 +0800)
committerGitHub <noreply@github.com>
Tue, 12 Mar 2024 04:21:27 +0000 (04:21 +0000)
commite84e5db6de0306d514b1f1a9657931fb7197a188
tree98baff1bb68b2af272e32b74abaa721523c2e519
parent7f856d5d742dcb6febdb8a3f22cd9a8fecc69a4d
Lazy load object format with command line and don't do it in OpenRepository (#29712)

Most time, when invoking `git.OpenRepository`, `objectFormat` will not
be used, so it's a waste to invoke commandline to get the object format.
This PR make it a lazy operation, only invoke that when necessary.
15 files changed:
modules/git/blame_sha256_test.go
modules/git/blame_test.go
modules/git/commit_sha256_test.go
modules/git/repo_base_nogogit.go
modules/git/repo_commit.go
modules/git/repo_commit_gogit.go
modules/git/repo_commit_nogogit.go
modules/git/repo_compare.go
modules/git/repo_compare_test.go
modules/git/repo_index.go
modules/git/repo_tag.go
modules/git/repo_tag_test.go
modules/git/repo_tree_gogit.go
modules/git/repo_tree_nogogit.go
modules/git/tree_nogogit.go