mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-28 02:14:06 -05:00
272ae03341
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> |
||
---|---|---|
.. | ||
actions | ||
activitypub | ||
analyze | ||
assetfs | ||
auth | ||
avatar | ||
base | ||
cache | ||
charset | ||
container | ||
context | ||
contexttest | ||
csv | ||
doctor | ||
emoji | ||
eventsource | ||
generate | ||
git | ||
gitgraph | ||
graceful | ||
hcaptcha | ||
highlight | ||
hostmatcher | ||
html | ||
httpcache | ||
httplib | ||
indexer | ||
issue/template | ||
json | ||
label | ||
lfs | ||
log | ||
markup | ||
mcaptcha | ||
metrics | ||
migration | ||
nosql | ||
options | ||
packages | ||
paginator | ||
pprof | ||
private | ||
process | ||
proxy | ||
proxyprotocol | ||
public | ||
queue | ||
recaptcha | ||
references | ||
regexplru | ||
repository | ||
secret | ||
session | ||
setting | ||
sitemap | ||
ssh | ||
storage | ||
structs | ||
svg | ||
sync | ||
system | ||
templates | ||
test | ||
testlogger | ||
timeutil | ||
translation | ||
turnstile | ||
typesniffer | ||
updatechecker | ||
upload | ||
uri | ||
user | ||
util | ||
validation | ||
web | ||
webhook |