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.
gitea/modules/git
Giteabot 272ae03341
Make gogit Repository.GetBranchNames consistent (#28348) (#28386)
Backport #28348 by @AdamMajer

nogogit GetBranchNames() lists branches sorted in reverse commit date
order. On the other hand the gogit implementation doesn't apply any
ordering resulting in unpredictable behaviour. In my case, the unit
tests requiring particular order fail

    repo_branch_test.go:24:
                Error Trace:
               ./gitea/modules/git/repo_branch_test.go:24
                Error:          elements differ

                                extra elements in list A:
                                ([]interface {}) (len=1) {
                                 (string) (len=6) "master"
                                }

                                extra elements in list B:
                                ([]interface {}) (len=1) {
                                 (string) (len=7) "branch1"
                                }

                                listA:
                                ([]string) (len=2) {
                                 (string) (len=6) "master",
                                 (string) (len=7) "branch2"
                                }

                                listB:
                                ([]string) (len=2) {
                                 (string) (len=7) "branch1",
                                 (string) (len=7) "branch2"
                                }
                Test:           TestRepository_GetBranches

To fix this, we sort branches based on their commit date in gogit
implementation.

Fixes: #28318

Co-authored-by: Adam Majer <amajer@suse.de>
1 year ago
..
foreachref Replace `interface{}` with `any` (#25686) 2 years ago
internal Refactor git command package to improve security and maintainability (#22678) 2 years ago
pipeline Refactor and tidy-up the merge/update branch code (#22568) 2 years ago
tests/repos Support `.git-blame-ignore-revs` file (#26395) 1 year ago
url Implement FSFE REUSE for golang files (#21840) 2 years ago
README.md move code.gitea.io/git to code.gitea.io/gitea/modules/git (#6364) 6 years ago
batch_reader.go Make git batch operations use parent context timeout instead of default timeout (#26325) 2 years ago
blame.go Read `previous` info from git blame (#28306) (#28310) 1 year ago
blame_test.go Read `previous` info from git blame (#28306) (#28310) 1 year ago
blob.go Fix profile render when the README.md size is larger than 1024 bytes (#25131) 2 years ago
blob_gogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
blob_nogogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
blob_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
command.go Clarify the git command Stdin hanging problem (#26967) 1 year ago
command_race_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
command_test.go Improve git log for debugging (#24095) 2 years ago
commit.go Convert git commit summary to valid UTF8. (#28356) (#28358) 1 year ago
commit_convert_gogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
commit_info.go Implement FSFE REUSE for golang files (#21840) 2 years ago
commit_info_gogit.go Replace `interface{}` with `any` (#25686) 2 years ago
commit_info_nogogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
commit_info_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
commit_reader.go Implement FSFE REUSE for golang files (#21840) 2 years ago
commit_test.go Add merge files files to GetCommitFileStatus (#20515) 2 years ago
diff.go Implement FSFE REUSE for golang files (#21840) 2 years ago
diff_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
error.go Implement FSFE REUSE for golang files (#21840) 2 years ago
git.go Update tool dependencies, lock govulncheck and actionlint (#25655) 2 years ago
git_test.go Support changing git config through `app.ini`, use `diff.algorithm=histogram` by default (#24860) 2 years ago
hook.go Implement FSFE REUSE for golang files (#21840) 2 years ago
last_commit_cache.go Replace `interface{}` with `any` (#25686) 2 years ago
last_commit_cache_gogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
last_commit_cache_nogogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
log_name_status.go Remove redundant nil check in `WalkGitLog` (#26773) 2 years ago
notes.go Implement FSFE REUSE for golang files (#21840) 2 years ago
notes_gogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
notes_nogogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
notes_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
parse_gogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
parse_gogit_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
parse_nogogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
parse_nogogit_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
ref.go Fix compatible for webhook ref type (#25195) 2 years ago
ref_test.go Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) 2 years ago
remote.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo.go Fix git 2.11 error when checking IsEmpty (#27393) (#27397) 1 year ago
repo_archive.go Refactor git command package to improve security and maintainability (#22678) 2 years ago
repo_attribute.go Refactor legacy strange git operations (#22756) 2 years ago
repo_attribute_test.go Use more specific test methods (#24265) 2 years ago
repo_base.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_base_gogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_base_nogogit.go Update tool dependencies, lock govulncheck and actionlint (#25655) 2 years ago
repo_blame.go Remove `git.FileBlame` (#25841) 2 years ago
repo_blob.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_blob_gogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_blob_nogogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_blob_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_branch.go Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) 2 years ago
repo_branch_gogit.go Make gogit Repository.GetBranchNames consistent (#28348) (#28386) 1 year ago
repo_branch_nogogit.go Refactor git command package to improve security and maintainability (#22678) 2 years ago
repo_branch_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_commit.go Pass 'not' to commit count (#24473) 2 years ago
repo_commit_gogit.go Fix commit retrieval by tag (#21804) 2 years ago
repo_commit_nogogit.go Fix commit retrieval by tag (#21804) 2 years ago
repo_commit_test.go Use more specific test methods (#24265) 2 years ago
repo_commitgraph.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_commitgraph_gogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_compare.go Support getting changed files when commit ID is `EmptySHA` (#26290) 2 years ago
repo_compare_test.go Support getting changed files when commit ID is `EmptySHA` (#26290) 2 years ago
repo_gpg.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_hook.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_index.go Update tool dependencies, lock govulncheck and actionlint (#25655) 2 years ago
repo_language_stats.go Merge different languages for language stats (#24900) 2 years ago
repo_language_stats_gogit.go Merge different languages for language stats (#24900) 2 years ago
repo_language_stats_nogogit.go Merge different languages for language stats (#24900) 2 years ago
repo_language_stats_test.go Merge different languages for language stats (#24900) 2 years ago
repo_object.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_ref.go Show branches and tags that contain a commit (#25180) 2 years ago
repo_ref_gogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_ref_nogogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_ref_test.go Fix commit retrieval by tag (#21804) 2 years ago
repo_stats.go Refactor git command package to improve security and maintainability (#22678) 2 years ago
repo_stats_test.go Fix commit retrieval by tag (#21804) 2 years ago
repo_tag.go Refactor git command package to improve security and maintainability (#22678) 2 years ago
repo_tag_gogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_tag_nogogit.go Refactor git command package to improve security and maintainability (#22678) 2 years ago
repo_tag_test.go Use more specific test methods (#24265) 2 years ago
repo_test.go Faster git.GetDivergingCommits (#24482) 2 years ago
repo_tree.go Refactor git command package to improve security and maintainability (#22678) 2 years ago
repo_tree_gogit.go Use complete SHA to create and query commit status (#22244) 2 years ago
repo_tree_nogogit.go Use complete SHA to create and query commit status (#22244) 2 years ago
sha1.go Support getting changed files when commit ID is `EmptySHA` (#26290) 2 years ago
sha1_gogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
sha1_nogogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
sha1_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
signature.go Implement FSFE REUSE for golang files (#21840) 2 years ago
signature_gogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
signature_nogogit.go Update tool dependencies, lock govulncheck and actionlint (#25655) 2 years ago
submodule.go Implement FSFE REUSE for golang files (#21840) 2 years ago
submodule_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tag.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tag_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tree.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tree_blob.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tree_blob_gogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tree_blob_nogogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tree_entry.go Remember to attach the parent tree when converting TreeEntry() -> Tree() (#22902) 2 years ago
tree_entry_gogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tree_entry_mode.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tree_entry_nogogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tree_entry_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tree_gogit.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tree_nogogit.go Refactor git command package to improve security and maintainability (#22678) 2 years ago
utils.go Replace `interface{}` with `any` (#25686) 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.