mirror of https://github.com/go-gitea/gitea.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4938945668
Currently gitea shows no commit information for files starting with a colon. [I set up a minimal repro repository that reproduces this error once it's migrated on gitea](https://github.com/kbolashev/colon-test) <img width="1209" alt="image" src="https://user-images.githubusercontent.com/111061261/219326625-0e6d3a86-8b58-4d67-bc24-8a78963f36b9.png"> This is happening because the filenames piped to the `git log` command are written as is, and it doesn't work when you have a colon at the start of the filename, and you need to escape it. You can test it locally, if you do ``` mkdir repo git init touch :file git add . && git commit -m "Add file with colon" git log -- :file ``` git log returns nothing. However, if you do `git log -- "\:file"`, it will show the commit with the file change. This PR escapes the starting colons in paths in the `LogNameStatusRepo` function, making gitea return commit info about the file with the bad filename. <img width="1209" alt="image" src="https://user-images.githubusercontent.com/111061261/219328299-46451246-4006-45e3-89b1-c244635ded23.png"> This error shows up only with files starting with colon, anywhere else in filename is ok. Dashes at the beginning also seem to be working. I don't know gitea internals well enough to know where else this error can pop up, so I'm keeping this PR small as suggested by your contributor guide |
2 years ago | |
---|---|---|
.. | ||
foreachref | 2 years ago | |
internal | 2 years ago | |
pipeline | 2 years ago | |
tests/repos | 2 years ago | |
url | 2 years ago | |
README.md | 6 years ago | |
batch_reader.go | 2 years ago | |
blame.go | 2 years ago | |
blame_test.go | 2 years ago | |
blob.go | 2 years ago | |
blob_gogit.go | 2 years ago | |
blob_nogogit.go | 2 years ago | |
blob_test.go | 2 years ago | |
command.go | 2 years ago | |
command_race_test.go | 2 years ago | |
command_test.go | 2 years ago | |
commit.go | 2 years ago | |
commit_convert_gogit.go | 2 years ago | |
commit_info.go | 2 years ago | |
commit_info_gogit.go | 2 years ago | |
commit_info_nogogit.go | 2 years ago | |
commit_info_test.go | 2 years ago | |
commit_reader.go | 2 years ago | |
commit_test.go | 2 years ago | |
diff.go | 2 years ago | |
diff_test.go | 2 years ago | |
error.go | 2 years ago | |
git.go | 2 years ago | |
git_test.go | 2 years ago | |
hook.go | 2 years ago | |
last_commit_cache.go | 2 years ago | |
last_commit_cache_gogit.go | 2 years ago | |
last_commit_cache_nogogit.go | 2 years ago | |
log_name_status.go | 2 years ago | |
notes.go | 2 years ago | |
notes_gogit.go | 2 years ago | |
notes_nogogit.go | 2 years ago | |
notes_test.go | 2 years ago | |
parse_gogit.go | 2 years ago | |
parse_gogit_test.go | 2 years ago | |
parse_nogogit.go | 2 years ago | |
parse_nogogit_test.go | 2 years ago | |
ref.go | 2 years ago | |
remote.go | 2 years ago | |
repo.go | 2 years ago | |
repo_archive.go | 2 years ago | |
repo_attribute.go | 2 years ago | |
repo_attribute_test.go | 2 years ago | |
repo_base.go | 2 years ago | |
repo_base_gogit.go | 2 years ago | |
repo_base_nogogit.go | 2 years ago | |
repo_blame.go | 2 years ago | |
repo_blob.go | 2 years ago | |
repo_blob_gogit.go | 2 years ago | |
repo_blob_nogogit.go | 2 years ago | |
repo_blob_test.go | 2 years ago | |
repo_branch.go | 2 years ago | |
repo_branch_gogit.go | 2 years ago | |
repo_branch_nogogit.go | 2 years ago | |
repo_branch_test.go | 2 years ago | |
repo_commit.go | 2 years ago | |
repo_commit_gogit.go | 2 years ago | |
repo_commit_nogogit.go | 2 years ago | |
repo_commit_test.go | 2 years ago | |
repo_commitgraph.go | 2 years ago | |
repo_commitgraph_gogit.go | 2 years ago | |
repo_compare.go | 2 years ago | |
repo_compare_test.go | 2 years ago | |
repo_gpg.go | 2 years ago | |
repo_hook.go | 2 years ago | |
repo_index.go | 2 years ago | |
repo_language_stats.go | 2 years ago | |
repo_language_stats_gogit.go | 2 years ago | |
repo_language_stats_nogogit.go | 2 years ago | |
repo_language_stats_test.go | 2 years ago | |
repo_object.go | 2 years ago | |
repo_ref.go | 2 years ago | |
repo_ref_gogit.go | 2 years ago | |
repo_ref_nogogit.go | 2 years ago | |
repo_ref_test.go | 2 years ago | |
repo_stats.go | 2 years ago | |
repo_stats_test.go | 2 years ago | |
repo_tag.go | 2 years ago | |
repo_tag_gogit.go | 2 years ago | |
repo_tag_nogogit.go | 2 years ago | |
repo_tag_test.go | 2 years ago | |
repo_test.go | 2 years ago | |
repo_tree.go | 2 years ago | |
repo_tree_gogit.go | 2 years ago | |
repo_tree_nogogit.go | 2 years ago | |
sha1.go | 2 years ago | |
sha1_gogit.go | 2 years ago | |
sha1_nogogit.go | 2 years ago | |
sha1_test.go | 2 years ago | |
signature.go | 2 years ago | |
signature_gogit.go | 2 years ago | |
signature_nogogit.go | 2 years ago | |
submodule.go | 2 years ago | |
submodule_test.go | 2 years ago | |
tag.go | 2 years ago | |
tag_test.go | 2 years ago | |
tree.go | 2 years ago | |
tree_blob.go | 2 years ago | |
tree_blob_gogit.go | 2 years ago | |
tree_blob_nogogit.go | 2 years ago | |
tree_entry.go | 2 years ago | |
tree_entry_gogit.go | 2 years ago | |
tree_entry_mode.go | 2 years ago | |
tree_entry_nogogit.go | 2 years ago | |
tree_entry_test.go | 2 years ago | |
tree_gogit.go | 2 years ago | |
tree_nogogit.go | 2 years ago | |
utils.go | 2 years ago | |
utils_test.go | 2 years ago |
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.