gitforge/modules/git
oliverpool fcce196fb8 fix(git): treat missing hooks folder the same as missing hook file (#12833)
Extracted from #12824 on suggestion of @limiting-factor; refactored after @Gusted pointed out forgejo/forgejo!12335.

Behavior change: previously a missing `hooks` folder in a repository tree (should not happen before forgejo/forgejo!12335) would return a 500 on `/api/v1/repos/%s/hooks/git`. It now returns a 200, with the same reply as an empty `hooks` folder.

Test has been added to ensure correct handling of missing `hooks` folder and of its creation if necessary.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12833
Reviewed-by: limiting-factor <limiting-factor@noreply.codeberg.org>
2026-05-31 14:41:28 +02:00
..
foreachref
internal
pipeline
pushoptions
tests/repos
url
batch.go
batch_reader.go
blame.go
blame_sha256_test.go
blame_test.go
blob.go chore: use io.ReadFull instead of io.ReadAll for DataAsync (#12795) 2026-05-28 23:51:15 +02:00
blob_test.go chore: use io.ReadFull instead of io.ReadAll for DataAsync (#12795) 2026-05-28 23:51:15 +02:00
command.go
command_race_test.go
command_test.go
commit.go
commit_info.go
commit_info_test.go
commit_reader.go
commit_sha256_test.go
commit_test.go
diff.go
diff_compare.go
diff_compare_test.go
diff_test.go
error.go
fetch.go
fetch_test.go
git.go
git_test.go
grep.go
grep_test.go
hook.go fix(git): treat missing hooks folder the same as missing hook file (#12833) 2026-05-31 14:41:28 +02:00
hook_generate.go
last_commit_cache.go
log_name_status.go
notes.go
notes_test.go
object_format.go
object_id.go
object_id_test.go
object_signature.go
parse.go
parse_test.go
README.md
ref.go
ref_test.go
remote.go
repo.go fix(git): treat missing hooks folder the same as missing hook file (#12833) 2026-05-31 14:41:28 +02:00
repo_archive.go
repo_attribute.go
repo_attribute_test.go
repo_base.go
repo_base_test.go
repo_blame.go
repo_blame_test.go
repo_blob_test.go
repo_branch.go
repo_branch_test.go
repo_commit.go
repo_commit_test.go
repo_commitgraph.go
repo_compare.go
repo_compare_test.go
repo_gpg.go
repo_hook.go
repo_index.go
repo_language_stats.go
repo_language_stats_test.go
repo_object.go
repo_ref.go
repo_ref_test.go
repo_stats.go
repo_stats_test.go
repo_tag.go
repo_tag_test.go
repo_test.go feat: prevent default git templates to be created (#12335) 2026-05-30 14:02:03 +02:00
repo_tree.go
signature.go
signature_test.go
submodule.go
submodule_test.go
tag.go
tag_test.go
tree.go
tree_blob.go
tree_entry.go
tree_entry_mode.go
tree_entry_test.go
tree_test.go
utils.go fix(git): treat missing hooks folder the same as missing hook file (#12833) 2026-05-31 14:41:28 +02:00
utils_test.go

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.