1
0
Fork 0
gitea/modules
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>
2023-12-07 13:03:27 -05:00
..
actions
activitypub
analyze
assetfs
auth
avatar
base
cache
charset
container
context Add guide page to actions when there's no workflows (#28145) (#28153) 2023-11-22 02:29:54 +00:00
contexttest
csv
doctor Fix delete-orphaned-repos (#28200) (#28202) 2023-11-24 14:54:14 -05:00
emoji
eventsource
generate
git Make gogit Repository.GetBranchNames consistent (#28348) (#28386) 2023-12-07 13:03:27 -05:00
gitgraph
graceful
hcaptcha
highlight
hostmatcher
html
httpcache
httplib
indexer Meilisearch: require all query terms to be matched (#28293) (#28296) 2023-11-29 09:38:04 -06:00
issue/template
json
label
lfs
log
markup Render email addresses as such if followed by punctuation (#27987) (#27992) 2023-11-11 13:26:18 +08:00
mcaptcha
metrics
migration
nosql
options
packages Close all hashed buffers (#27787) (#27790) 2023-10-25 22:24:25 +02:00
paginator
pprof
private
process
proxy
proxyprotocol
public
queue
recaptcha
references
regexplru
repository Ignore "non-existing" errors when getDirectorySize calculates the size (#28276) (#28285) 2023-11-30 16:39:16 +00:00
secret
session
setting Fix incorrect default value of `[attachment].MAX_SIZE` (#28373) (#28376) 2023-12-06 19:32:23 +00:00
sitemap
ssh
storage
structs Fix package webhook (#27839) (#27855) 2023-10-31 11:26:28 +01:00
svg
sync
system
templates Fix label render containing invalid HTML (#27752) (#27762) 2023-10-24 09:39:13 +08:00
test
testlogger
timeutil
translation
turnstile
typesniffer
updatechecker
upload
uri
user
util
validation
web Make CORS work for oauth2 handlers (#28184) (#28185) 2023-11-23 22:27:00 +08:00
webhook